[musl] Re: [PATCH v1] man/man3/crypt.3: These functions accept many algorithms, not only DES

Alejandro Colomar alx+linux-man@kernel.org
Thu Nov 12 13:26:15 GMT 2026


Hi Vincent,

> Date: 2026-11-12 14:15:47+0100
> From: Vincent Lefevre <vincent@vinc17.net>
>
> On 2026-11-12 13:08:12 +0100, Alejandro Colomar wrote:
> > > This means that when "$" is supported by some implementation,
> > > the interpretation of the return value may be different from
> > > what POSIX specifies.
> > 
> > Kind of.  They better don't deviate from it in non-confirming ways;
> > one could argue that musl's "x" return value is indeed such a
> > non-conforming return value, and a NULL return value would be better
> > (both more conforming and safer).
> 
> This is more complex. The issue is that in the past, crypt() seemed to
> have been designed so that it could not fail (except in the case where
> it wasn't providing any implementation, i.e. it was always failing),
> so that applications did not expect a null pointer and some of them
> still do not check this case. Hence the choice done my musl.

It would be interesting to list all FOSS programs that forget to check
for NULL, and perhaps talk to them to update their code.


Cheers,
Alex

> Problems could be avoided only by writing more robust applications:
>   * They should have had a check for the null pointer.
>   * When a hash is obtained, applications should also check
>     whether the hash has the expected form (for instance,
>     the "*" returned by musl does not).
> 
> -- 
> Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
> Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

-- 
<https://www.alejandro-colomar.es>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20261112/09c22b5e/attachment.sig>


More information about the Libc-alpha mailing list