Skip Menu |

This queue is for tickets about the perl-ldap CPAN distribution.

Report information
The Basics
Id: 39111
Status: resolved
Priority: 0/
Queue: perl-ldap

People
Owner: Nobody in particular
Requestors: rest [...] xicon.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: LDAP Filter Options ignore ">=" (greater than)
Hi, i try to get a list of LDAP-users with the Perl-modul "Net::LDAP". Everything works fine for me, but the filter options with ">=" (greater than). If i try to get all users with a greater uidNumber than 1000, LDAP returns nothing. I use the Debug-Output, so you can see, what the LDAP-server returns. Platform: Mac OS X Server v10.5.4 Perl: 5.8.8 Attached Files: - output_with_equal => output of version with ("uidNumber=1000") => works fine - output_with_greater => output of version with ("uidNumber>=1000") => won't work - net-ldap2 => the test-script - output_perl_version => complete output of "perl -V"
Subject: output_with_greater.txt
Net::LDAP=HASH(0x8d3c6c) sending: 30 33 02 01 01 60 2E 02 01 03 04 1F 75 69 64 3D 03...`......uid= 64 69 72 61 64 6D 69 6E 2C 63 6E 3D 75 73 65 72 diradmin,cn=user 73 2C 64 63 3D 69 6E 74 65 72 6E 80 08 70 61 73 s,dc=intern..pas 73 77 6F 72 64 __ __ __ __ __ __ __ __ __ __ __ sword Net::LDAP=HASH(0x8d3c6c) received: 30 0C 02 01 01 61 07 0A 01 31 04 00 04 00 __ __ 0....a...1.... Net::LDAP=HASH(0x8d3c6c) sending: 30 3D 02 01 02 63 38 04 12 63 6E 3D 75 73 65 72 0=...c8..cn=user 73 2C 64 63 3D 69 6E 74 65 72 6E 0A 01 02 0A 01 s,dc=intern..... 02 02 01 00 02 01 00 01 01 00 A5 11 04 09 75 69 ..............ui 64 4E 75 6D 62 65 72 04 04 31 30 30 30 30 00 __ dNumber..10000. Net::LDAP=HASH(0x8d3c6c) received: 30 0C 02 01 02 65 07 0A 01 00 04 00 04 00 __ __ 0....e........
Subject: output_with_equal.txt
Net::LDAP=HASH(0x8d3c6c) sending: 30 33 02 01 01 60 2E 02 01 03 04 1F 75 69 64 3D 03...`......uid= 64 69 72 61 64 6D 69 6E 2C 63 6E 3D 75 73 65 72 diradmin,cn=user 73 2C 64 63 3D 69 6E 74 65 72 6E 80 08 70 61 73 s,dc=intern..pas 73 77 6F 72 64 __ __ __ __ __ __ __ __ __ __ __ sword Net::LDAP=HASH(0x8d3c6c) received: 30 0C 02 01 01 61 07 0A 01 31 04 00 04 00 __ __ 0....a...1.... Net::LDAP=HASH(0x8d3c6c) sending: 30 3D 02 01 02 63 38 04 12 63 6E 3D 75 73 65 72 0=...c8..cn=user 73 2C 64 63 3D 69 6E 74 65 72 6E 0A 01 02 0A 01 s,dc=intern..... 02 02 01 00 02 01 00 01 01 00 A3 11 04 09 75 69 ..............ui 64 4E 75 6D 62 65 72 04 04 31 30 30 30 30 00 __ dNumber..10000. Net::LDAP=HASH(0x8d3c6c) received: 30 82 05 2C 02 01 02 64 82 05 25 04 1F 75 69 64 0..,...d..%..uid 3D 64 69 72 61 64 6D 69 6E 2C 63 6E 3D 75 73 65 =diradmin,cn=use 72 73 2C 64 63 3D 69 6E 74 65 72 6E 30 82 05 00 rs,dc=intern0... 30 11 04 03 75 69 64 31 0A 04 08 64 69 72 61 64 0...uid1...dirad 6D 69 6E 30 7C 04 0B 6F 62 6A 65 63 74 43 6C 61 min0|..objectCla 73 73 31 6D 04 0D 69 6E 65 74 4F 72 67 50 65 72 ss1m..inetOrgPer 73 6F 6E 04 0C 70 6F 73 69 78 41 63 63 6F 75 6E son..posixAccoun 74 04 0D 73 68 61 64 6F 77 41 63 63 6F 75 6E 74 t..shadowAccount 04 0A 61 70 70 6C 65 2D 75 73 65 72 04 10 65 78 ..apple-user..ex 74 65 6E 73 69 62 6C 65 4F 62 6A 65 63 74 04 14 tensibleObject.. 6F 72 67 61 6E 69 7A 61 74 69 6F 6E 61 6C 50 65 organizationalPe 72 73 6F 6E 04 03 74 6F 70 04 06 70 65 72 73 6F rson..top..perso 6E 30 11 04 09 67 69 64 4E 75 6D 62 65 72 31 04 n0...gidNumber1. 04 02 32 30 30 18 04 09 67 69 76 65 6E 4E 61 6D ..200...givenNam 65 31 0B 04 09 44 69 72 65 63 74 6F 72 79 30 19 e1...Directory0. 04 0A 6C 6F 67 69 6E 53 68 65 6C 6C 31 0B 04 09 ..loginShell1... 2F 62 69 6E 2F 62 61 73 68 30 15 04 02 73 6E 31 /bin/bash0...sn1 0F 04 0D 41 64 6D 69 6E 69 73 74 72 61 74 6F 72 ...Administrator 30 1F 04 02 63 6E 31 19 04 17 44 69 72 65 63 74 0...cn1...Direct 6F 72 79 20 41 64 6D 69 6E 69 73 74 72 61 74 6F ory Administrato 72 30 13 04 09 75 69 64 4E 75 6D 62 65 72 31 06 r0...uidNumber1. 04 04 31 30 30 30 30 82 03 65 04 0D 61 75 74 68 ..10000..e..auth 41 75 74 68 6F 72 69 74 79 31 82 03 52 04 82 01 Authority1..R... 99 3B 41 70 70 6C 65 50 61 73 73 77 6F 72 64 53 .;ApplePasswordS 65 72 76 65 72 3B 30 78 30 30 30 30 30 30 30 30 erver;0x00000000 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000 30 30 30 30 30 30 30 31 2C 31 30 32 34 20 33 35 00000001,1024 35 20 31 31 34 31 37 37 32 37 36 32 33 37 30 36 39 114177276237069 35 37 35 37 30 30 30 31 35 35 38 34 30 35 33 30 5757000155840530 31 30 31 37 31 37 36 32 37 34 31 32 36 39 31 37 1017176274126917 36 31 33 33 30 34 38 33 33 39 36 38 39 33 30 30 6133048339689300 31 32 30 37 37 32 39 38 39 38 32 38 31 33 30 32 1207729898281302 33 34 38 38 39 35 32 39 32 35 30 38 34 33 39 39 3488952925084399 39 31 37 37 31 36 33 31 30 39 31 35 34 33 36 37 9177163109154367 38 36 32 39 37 39 36 32 38 31 31 34 37 39 39 38 8629796281147998 38 30 39 32 39 32 36 31 39 30 38 33 37 32 36 39 8092926190837269 31 39 35 36 39 38 33 38 38 33 30 36 35 38 30 38 1956983883065808 31 39 36 38 39 30 39 30 39 33 32 39 34 34 33 31 1968909093294431 33 35 30 36 38 34 38 36 39 37 32 34 37 34 31 31 3506848697247411 39 33 37 35 34 37 39 31 34 32 39 33 38 31 35 34 9375479142938154 35 34 39 31 36 35 32 34 32 30 33 31 37 36 37 38 5491652420317678 34 34 35 37 35 39 33 38 30 30 34 31 32 33 32 36 4457593800412326 34 30 36 31 32 31 34 39 33 35 34 32 33 35 33 35 4061214935423535 37 31 35 33 34 38 33 35 34 34 31 30 35 36 39 36 7153483544105696 35 30 33 36 33 37 36 33 31 34 37 33 33 35 38 30 5036376314733580 31 34 39 39 35 32 37 39 33 39 31 32 31 32 39 32 1499527939121292 36 39 38 37 38 39 20 72 6F 6F 74 40 73 63 68 75 698789 root@schu 6C 73 65 72 76 65 72 2E 69 6E 74 65 72 6E 3A 31 lserver.intern:1 39 32 2E 31 36 38 2E 30 2E 33 04 82 01 B1 3B 4B 92.168.0.3....;K 65 72 62 65 72 6F 73 76 35 3B 30 78 30 30 30 30 erberosv5;0x0000 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000 30 30 30 30 30 30 30 30 30 30 30 31 3B 64 69 72 000000000001;dir 61 64 6D 69 6E 40 53 43 48 55 4C 53 45 52 56 45 admin@SCHULSERVE 52 3B 53 43 48 55 4C 53 45 52 56 45 52 3B 31 30 R;SCHULSERVER;10 32 34 20 33 35 20 31 31 34 31 37 37 32 37 36 32 24 35 1141772762 33 37 30 36 39 35 37 35 37 30 30 30 31 35 35 38 3706957570001558 34 30 35 33 30 31 30 31 37 31 37 36 32 37 34 31 4053010171762741 32 36 39 31 37 36 31 33 33 30 34 38 33 33 39 36 2691761330483396 38 39 33 30 30 31 32 30 37 37 32 39 38 39 38 32 8930012077298982 38 31 33 30 32 33 34 38 38 39 35 32 39 32 35 30 8130234889529250 38 34 33 39 39 39 31 37 37 31 36 33 31 30 39 31 8439991771631091 35 34 33 36 37 38 36 32 39 37 39 36 32 38 31 31 5436786297962811 34 37 39 39 38 38 30 39 32 39 32 36 31 39 30 38 4799880929261908 33 37 32 36 39 31 39 35 36 39 38 33 38 38 33 30 3726919569838830 36 35 38 30 38 31 39 36 38 39 30 39 30 39 33 32 6580819689090932 39 34 34 33 31 33 35 30 36 38 34 38 36 39 37 32 9443135068486972 34 37 34 31 31 39 33 37 35 34 37 39 31 34 32 39 4741193754791429 33 38 31 35 34 35 34 39 31 36 35 32 34 32 30 33 3815454916524203 31 37 36 37 38 34 34 35 37 35 39 33 38 30 30 34 1767844575938004 31 32 33 32 36 34 30 36 31 32 31 34 39 33 35 34 1232640612149354 32 33 35 33 35 37 31 35 33 34 38 33 35 34 34 31 2353571534835441 30 35 36 39 36 35 30 33 36 33 37 36 33 31 34 37 0569650363763147 33 33 35 38 30 31 34 39 39 35 32 37 39 33 39 31 3358014995279391 32 31 32 39 32 36 39 38 37 38 39 20 72 6F 6F 74 21292698789 root 40 73 63 68 75 6C 73 65 72 76 65 72 2E 69 6E 74 @schulserver.int 65 72 6E 3A 31 39 32 2E 31 36 38 2E 30 2E 33 30 ern:192.168.0.30 3C 04 12 61 70 70 6C 65 2D 67 65 6E 65 72 61 74 <..apple-generat 65 64 75 69 64 31 26 04 24 44 42 46 35 45 44 43 eduid1&.$DBF5EDC 44 2D 37 39 34 31 2D 34 30 31 35 2D 41 41 31 32 D-7941-4015-AA12 2D 33 44 42 30 34 38 44 39 42 38 30 30 30 1A 04 -3DB048D9B8000.. 0C 75 73 65 72 50 61 73 73 77 6F 72 64 31 0A 04 .userPassword1.. 08 2A 2A 2A 2A 2A 2A 2A 2A 30 15 04 0D 68 6F 6D .********0...hom 65 44 69 72 65 63 74 6F 72 79 31 04 04 02 39 39 eDirectory1...99 Net::LDAP=HASH(0x8d3c6c) received: 30 0C 02 01 02 65 07 0A 01 00 04 00 04 00 __ __ 0....e........ Directory Administrator diradmin 1000
Subject: net-ldap2.pl
#!/usr/bin/perl use strict; use warnings; use Net::LDAP; use Net::LDAP::Filter; # ldap-vars my $ldap_server = "127.0.0.1"; my $ldap_port = "389"; my $base = "cn=users,dc=intern"; my $filter = Net::LDAP::Filter->new( "(uidNumber>=1000)" ); # ldap connect my $ldap = Net::LDAP->new( $ldap_server, PORT => $ldap_port, debug => 3) or die "$@"; my $mesg = $ldap->bind('uid=diradmin,cn=users,dc=intern',password => "password"); $mesg = $ldap->search( base => $base, filter=> $filter, ) or die "$!"; foreach my $entry ($mesg->all_entries) { print $entry->get_value('cn')."\n"; print $entry->get_value('uid')."\n"; print $entry->get_value('uidNumber')."\n"; }
Subject: output_perl_version.txt
Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=darwin, osvers=9.0, archname=darwin-thread-multi-2level uname='darwin omen.apple.com 9.0 darwin kernel version 9.0.0b5: mon sep 10 17:17:11 pdt 2007; root:xnu-1166.6~1release_ppc power macintosh ' config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe -Dldflags=-Dman3ext=3pm -Duseithreads -Duseshrplib' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-arch i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include', optimize='-O3', cppflags='-no-cpp-precomp -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include' ccversion='', gccversion='4.0.1 (Apple Inc. build 5465)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc -mmacosx-version-min=10.5', ldflags ='-arch i386 -arch ppc -L/usr/local/lib' libpth=/usr/local/lib /usr/lib libs=-ldbm -ldl -lm -lutil -lc perllibs=-ldl -lm -lutil -lc libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, libperl=libperl.dylib gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-arch i386 -arch ppc -bundle -undefined dynamic_lookup -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Locally applied patches: fix for regcomp CVE-2007-5116 security vulnerability Built under darwin Compiled at Dec 7 2007 09:37:29 @INC: /System/Library/Perl/5.8.8/darwin-thread-multi-2level /System/Library/Perl/5.8.8 /Library/Perl/5.8.8/darwin-thread-multi-2level /Library/Perl/5.8.8 /Library/Perl /Network/Library/Perl/5.8.8/darwin-thread-multi-2level /Network/Library/Perl/5.8.8 /Network/Library/Perl /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.8 /Library/Perl/5.8.6 /Library/Perl/5.8.1
Subject: Re: [rt.cpan.org #39111] LDAP Filter Options ignore ">=" (greater than)
Date: Tue, 9 Sep 2008 08:30:26 -0500
To: bug-perl-ldap [...] rt.cpan.org
From: Graham Barr <gbarr [...] pobox.com>
On Sep 9, 2008, at 2:24 AM, XiCoN-FJS- via RT wrote: Show quoted text
> i try to get a list of LDAP-users with the Perl-modul "Net::LDAP". > Everything works fine for me, but the filter options with > ">=" (greater > than). If i try to get all users with a greater uidNumber than 1000, > LDAP returns nothing. I use the Debug-Output, so you can see, what the > LDAP-server returns.
This not a bug with Net::LDAP. For an attribute to support >= it must have an ORDERING rule defined. Most attributes do not. nis.schema defined uidNumber as attributetype ( 1.3.6.1.1.1.1.0 NAME 'uidNumber' DESC 'An integer uniquely identifying a user in an administrative domain' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) which does not have an ORDERING rule. You would see the same result if you use command-line tools to perform the search ldapsearch -x -b "cn=users,dc=intern" "(uidNumber>=1000)" Graham.