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

Re: ldap tool result codes



Pierangelo Masarati writes:
>To: "Hallvard B Furuseth" <h.b.furuseth@usit.uio.no>
>> 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).

Yes.  Or even 0->127, since $? in the shell is 128 + signal number when
the process died due to signal.  No idea if that's standard or a
deliberate bash feature or what, or if it's just lazy OS-dependent code.
For other codes, we'd return that special code.  Or maybe just translate
them to LDAP_OTHER.  I seem to remember there were some result codes
reserved for the API (around code 80?), but cannot find that.

There are also OSes (VMS?) where exit status of 0 produces a failure
termination status and/or where some nonzero exit statuses mean success.
There, the C code exit(0) and exit(EXIT_SUCCESS) is turned into some
success termination status in the OS, and exit(EXIT_FAILURE) gives some
failure.  The termination status from other exit() arguments is not
specified by the C standard.  I have no idea if such an OS exists to
which it is feasible to port OpenLDAP.

> I'd prefer LDAP error codes, too (at least the most "popular" ones,
> which are well below 255).

-- 
Hallvard