For your main problem, a filter that will always find everything is
objectClass=*
I haven't used the version options.
On Tue, 4 Dec 2001, Adrien Demarez wrote:
> Hello,
> (sorry for my poor English, I'm french !)
>
> First of all, I'd like to thank you for this cool and simple module (which doesn't need to get any other SDK installed).
> But... I've got a little problem (notice I'm not an experienced LDAP user, and I'm running openldap 2.0.18, perl 5.601, perl-ldap 0.25) :
>
> 1) With a "normal" LDAP request (ldapsearch -x, for example) without filter, I get _every_ record under the base object (since the query is not filtered).
>
> But with perl-ldap (take for example the code below), I can't get anything if I don't specify a filter in the query, or if I specify "", or "*", or anything else (I get "Bad filter at ./LDAPtest2.pl"). That means I gan't get the whole tree in a simple request...
> $ldap = Net::LDAP->new("adrien.mandrakesoft.com", onerror=>"die", version=>3, timeout=>5) or die "$@";
> my $result = $ldap->search(base=>"dc=example,dc=com", scope=>"one", attrs=>['*']); #No more results (same filter error) with filter=>"", filter=>"*", filter=>"dn=*", filter=>"dn", etc...
> foreach $entr ($result->entries) {print "dn: ", $entr->dn, "\n";}
>
> Can you help me ?
>
> 2) Another (lillte) thing with the version :
> a 'print "version LDAP : ",$ldap->version,"\n";' simply return the string passed in the "version=>" argument. That means if I do
>
> $ldap = Net::LDAP->new("adrien.mandrakesoft.com", onerror=>"die", version=>"stupid_string", timeout=>5) or die "$@";
> print "version LDAP : ",$ldap->version,"\n"; #to verify the LDAP protocol used
>
> I get "version LDAP : stupid_string" and everything continues whereas the script should die with an error like "unrecognized protocol".
>
> How can I then check the _real_ protocol used ?
>
> --
> Adrien Demarez
>
|