On 6 Dec 2007, at 16:43, Brian G wrote:
I run this command and I get the expected result:
ldapsearch -h 10.19.15.50 -x -b
ou=addresslist,ou=test,ou=cfmrs,ou=sftaccess,o=sft -s one dn
I then try to emulate this command with Net::LDAP using this code
and get
nothing:
my $scope = "one";
my $ldap = Net::LDAP->new("10.19.15.50") or die "$@";
my $mesg = $ldap->search(
base =>
"ou=addresslist,ou=test,ou=cfmrs,ou=sftaccess,o=sft",
scope => $scope,
attrs => ['*', 'dn'],
);
Neither search is specifying a filter. Maybe the ldapsearch program
you're using is using a default one? Try explicitly specifying a filter.
I don't think it'll make a difference, but you're requesting different
attributes back in both cases. Also are you certain your entries have
got attributes called "dn"? Entries in standard LDAP schemas do not
have such an attribute.
Cheers,
Chris