Collin Funk wrote:
> I still think that the Musl behavior is unexpected enough that it
> warrants overriding though.

OK.

> 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.

In general, writing a configure test vs. listing the platforms explicitly
is a trade-off.

Advantages of a configure test:
  - It handles the situation when an OS is forked or the code from the OS
    is copied into another OS.
  - It will automatically stop flagging the OS as not-working when the bug
    is fixed.

Advantages of an explicit platform list:
  - It's quicker to write.

In this case, as you say, since getusershell() always reads /etc/shells and
there is no way to portably replace it for the period of the configure test,
you are forced to test the platform explicitly.

Use this idiom:

  AC_REQUIRE([AC_CANONICAL_HOST])
  case "$host_os" in
    *-musl* | midipix*)

Bruno




Reply via email to