[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: library routines idempotent?



Paul Jarc writes:
>Hallvard B Furuseth <h.b.furuseth@usit.uio.no> wrote:
>> However, the spec (draft-ietf-ldapext-ldap-c-api-05.txt) does not
>> guarantee that the results will be in the same _order_.  As far as I can
>> tell, OpenLDAP does give the same order, though.
> 
> Ok.  So as long as I use OpenLDAP, is it safe to assume that the order
> of attributes returned by ldap_{first,next}_attribute will match the
> order of the attribute list originally passed to ldap_search?

No.

$ ldapsearch -xLLL -h ldap.uio.no -b ou=people,dc=uio,dc=no "(uid=hbf)" sn cn
dn: uid=hbf,ou=people,dc=uio,dc=no
cn: Hallvard B Furuseth
sn: Furuseth

$ ldapsearch -xLLL -h ldap.uio.no -b ou=people,dc=uio,dc=no "(uid=hbf)" cn sn
dn: uid=hbf,ou=people,dc=uio,dc=no
cn: Hallvard B Furuseth
sn: Furuseth

What I meant about same order is that two calls to e.g.
ldap_get_values() with the same arguments might in theory return the
values in different order.  OpenLDAP preserves the order in that case.

-- 
Hallvard