From: <eri...@hk...> - 2001-02-27 10:37:28
|
Dear all, I encounter a problem of using search utility. The following is my program and configuration. 0 ldap host A ip addrss: 172.15.208.11 dc=fin,dc=net \ \ 0 ldap host B ip address 172.15.208.12 dc=abc,dc=fin,dc=net I have set a referral entry to ldap host B on ldap host A. So, the search will search the host A and then host B. But now, I just want to search host A and retreive its entry only. I have tried the below search option but still fail, there are: $entry = $conn->search("dc=fin,dc=net", "", $filter, 0, @attr); Result: no entry found $entry = $conn->search("dc=fin,dc=net", "one", $filter, 0, @attr); Result: no entry found $entry = $conn->search("dc=fin,dc=net", "base", $filter, 0, @attr); Result: no entry found $entry = $conn->search("dc=fin,dc=net", "sub", $filter, 0, @attr); Result: no entry found $entry = $conn->search("", "", $filter, 0, @attr); It display the whole entry including the referral ldap host B database. $entry = $conn->search("dc=abc,dc=fin,dc=net", "", $filter, 0, @attr); It display all the entry of ldap host B database. Can anyone tell me how to set the search option just only search the root ldap server and not go to its referral ldap server. Thanks a lot!!!! Regards/Eric The program is: use Mozilla::LDAP::Conn; $conn = new Mozilla::LDAP::Conn ("172.15.206.11", "389", "", ""); die "No LDAP connection" unless $conn; @attr = ("cn", "sn", "mail"); $filter = "(cn=eric*)"; $base = "dc=finnet-hk,dc=net"; $entry = $conn->search("", "one", $filter, 0, @attr); $count=0; if ( ! $entry) { print (" handle this event, no entry"); } else { while ($entry) { $entry ->printLDIF(); $entry = $conn ->nextEntry(); } } close(FILE); ______________________________________________________________________ This message is intended only for use of the addressee and may contain information that is privileged and confidential. If you are not the intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply and delete this message from your system. |