From: Justin <da...@io...> - 2001-02-02 17:21:25
|
On Fri, Feb 02, 2001 at 08:40:28AM -0000, Chris Ridd wrote: > Justin <da...@io...> wrote: > > Greetings! > > > > > > I am using version 0.22 of the perl library and Netscape Directory Server > > version 4.12. Whenver I retrieve the list of attributes using something > > like: > > > > my $schema = $ldap->schema("cn=Schema"); > > my @atts = $schema->attributes(); > > > > the array returned from attributes() is all upper case. However, the > > values returned from the MUST and MAY listings for an object class, > > obtained by: > > > > my @may = $schema->item($oid, "may"); > > > > Returns a listing that is in Mixed Case, as it is returned from the > > directory. > > > > > > Can anyone explain why $schema->attributes does not return a mixed case > > listing? > > Attribute names are of course not case-sensitive, so returning them in all > upper-case does not really matter. > > But it is curious that it is inconsistent between the calls. Possibly the > attributes() call is returning the names after they've been internally > canonicalized, and the item call isn't. I think I can see this being done > in the _fixup_entry routine. Well, there are a bunch of calls to 'uc' in > there which weren't in the Schema module in perl-ldap 0.20, which returns > mixed case attributes from both calls. > > Does calling $schema->item($oid) return upper- or lower-case stuff? Calling $schema->item($att, "name") returns mixed case, which is what I want. (where $att is one of @att, returned from $schema->attributes()). However! The Netscape Directory Server 4.12 has multiple attributetype entries for a given OID. "cn" and "CommonName" for example, share an OID. I believe this is allowed as per rfc2251 section 4.1.4. So calling $schema->item($att, "name"), while it returns a mixed case name as I like, will only ever return "CommonName" and never "cn" (or both). Justin > > Cheers, > > Chris |