Hi Bruno, On 5/18/24 12:16 AM, Bruno Haible wrote: >> I'll submit a bug report on the musl lists now. > > Thanks.
I submitted a report yesterday but forgot to link here [1]. >> I don't think this function is used too much > > Probably no one noticed the bug before, because the typical use of > this function is to test whether a given shell string is valid, > as in [1], and for this use, the bug hardly matters. True. I think most programs care about the current users default shell (struct passwd.pw_shell) anyways, not the systems available shells. I still think that the Musl behavior is unexpected enough that it warrants overriding though. I don't see a way to check the behavior of getusershell () in configure checks though. Typically /etc/shells can only be written by root and a administrator can change it at any time. IIRC most distributions use a hook to edit it upon installing (or uninstalling) a shell package. Who knows if some add empty lines or comments in the process. What do you think about just replacing it on all Musl systems? I can write a patch if that solution seems reasonable to you. Collin [1] https://www.openwall.com/lists/musl/2024/05/18/1