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

Re: ldap tool result codes (was: commit: ldap/tests/scripts test007-replication test018-syncreplication-persist)



> ando@OpenLDAP.org writes:
>> 	test007-replication  1.67 -> 1.68
>> 	test018-syncreplication-persist  1.35 -> 1.36
>> ldapmodify doesn't return an LDAP error code
>
> How did we miss that for so long?

I based most of my tests on the assumption it did, but I "experimentally"
found out that sometimes it doesn't, and after reading the code I came to
the same conclusion.

>
> The ldapmodify source code looks like it intends to return
> a result code, though.  And it does sometimes.  E.g.
>
>     bash$ ldapmodify -xh ldap.uio.no < test.ldif
>     modifying entry "o=x"
>     ldap_modify: Server is unwilling to perform (53)
>             additional info: no global superior knowledge
>
>     bash$ echo $?
>     53
>
> Maybe we should change all the LDAP tools to always return some
> LDAP error code, and some special code when it cannot or when an
> LDAP code does not make sense?

The point is: LDAP error codes are integers, while command return codes
for portability __should__ limited to "chars" (o->255) as far as I can
tell (please correct me).  I'd prefer LDAP error codes, too (at least the
most "popular" ones, which are well below 255).

p.

-- 
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it


    SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497