- 论坛徽章:
- 0
|
Hi, 各位
我在Linux/Solaris用Perl ldap-perl 0.32访问ldap服务器
现在有个奇怪的问题:
当我用错误的用户名/密码访问时,会告诉我不对,但仍然会显示我所查询的结果。
在LDAP服务器禁止了匿名访问后,用ldapsearch之类也显示
Anonymous access disallow
但用Perl访问仍然可以。
不理解啊。
下面是一个简单的测试程序:
#!/usr/bin/perl
use Net::LDAP;
$lh = Net::LDAP ->; new(
'10.96.100.128',
);
$msg = $lh ->; bind(
'uid=someone,dc=company,dc=com',
password =>; '123',
);
#$msg = $lh ->; bind;
print $msg ->; error;
print "\n";
$result = $lh ->; search(
base =>; 'dc=company,dc=com',
attrs =>; ['uid','homeDirectory'],
filter =>; 'uid=snake',
);
$cnt = $result ->; count;
for($i = 0;$i < $cnt;$i++)
{
$entry = $result ->; entry($i);
foreach $attr($entry ->; attributes)
{
print $attr;
print "=";
print $entry ->; get_value($attr);
print ";\n";
}
}
$lh ->; unbind;
哪位遇见过这种情况?
谢谢。 |
|