From: Chris R. <chr...@me...> - 2000-11-29 10:46:19
|
Javier <te...@rd...> wrote: > Hello guys! > > Can somebody help me about this: > > I'm triying to get the object's schema from LDAP server, but I can't. > > I'm working with OpenLdap 2.0.7, I think that this version of LDAP server > support LDAPv3. Is it correct? Don't know, sorry. > I do this to get the schema: > > $dn="cn=Jane, ou=myDept, o=myorg, c=ES"; > $ldap= Net::LDAP->new('192.168.0.44', > debug=>0, > async=>1,); > $ldap->bind; > > $schema = $ldap->schema (dn => $dn); OK, that's not the way LDAP does it really. LDAPv3 servers store schema in special places called subentries in the directory, and places pointers (ie DNs) to those subentries in the subschemaSubentry attribute in the root DSE. What $ldap->schema() does is read the root entry, read the subschemaSubentry attribute from there, and then read the schema from those subentries. To shortcut this extra read, and to support servers that don't contain a subschemaSubentry attribute in the root DSE but do hold schema in the directory, you can also tell $ldap->schema() to read the subschema from a certain DN, by saying $ldap->schema(dn => 'where the subschema is') I think you should probably just remove the dn arguments from the call to $ldap->schema(). Cheers, Chris |