From: Justin <da...@io...> - 2001-02-01 22:51:27
|
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? Thanks! Justin |
From: Chris R. <chr...@me...> - 2001-02-02 08:40:51
|
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? Cheers, Chris |
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 |
From: Chris R. <chr...@me...> - 2001-02-02 17:41:56
|
Justin <da...@io...> wrote: > 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. Yes. Attributes have zero or more names. > 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). Cheers, Chris |
From: Justin <da...@io...> - 2001-02-02 18:48:01
|
> >> 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. > > Yes. Attributes have zero or more names. Thanks for the clarification. Shouldn't $schema->item($attribute_oid, "name") return a list of names then? I tried @fullnames = $schema->item($attribute_oid, "name"); since the item() function is aware of list vs. syntax context but it only ever seemed to return one name per OID. Thanks for the help, Justin |
From: Clif H. <cl...@di...> - 2001-02-02 19:47:12
|
> > 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 > > You can get the alias name(s) by retrieving the "aliases" from the schema object. Do something like the following; my $oid = $schema->name2oid( "<attribute, objectclass, or matchingrule name>" ); @item = $schema->item( $oid, "aliases" ); print "aliases: @item\n"; If you want to see how many and what items are associated with a retrieved "oid" do the following; my @items = $schema->items( "$oid" ); print "@items\"; Regards, Clif Harden INTERNET: c-h...@ti... Texas Instruments Directory Services 6500 Chase Oaks Blvd, M/S 8412 Plano, TX 75023 Voice: 972-575-0855 FAX: 972-575-2418 |