detecting musl (was Re: Call for testing: OpenSSH 8.9)

Thorsten Glaser t.glaser at tarent.de
Sat Feb 19 04:47:45 AEDT 2022


(retopiccing and trimming Cc)

On Fri, 18 Feb 2022, Steffen Nurpmeso wrote:

> Well it may look secondarily.  This is musl libc in the end.
> And note it does not, as per the snippet you removed, perform any
> action on its own, it just gives a hint for a specific configure
> option which does.

I don’t understand what you are trying to say here.

>  |>|Ouch, completely bogus.
>  |> 
>  |> It is a nice hint imho.
>  |
>  |Nope. It hardcodes a path into the *host* system. Absolutely wrong,
>  |on multiple counts. (It would also trigger, say, on a glibc system
>  |with musl installed.)

>  I am using the same mechanism (i have not
> invented it) in my ~/.profile, for setting LC_ALL.

It’s plain wrong, that’s what it is.

lrwxrwxrwx 1 root root 25  2. Okt 14:47 /lib/ld-linux.so.2 -> i386-linux-gnu/ld-2.31.so*
lrwxrwxrwx 1 root root 25 15. Jan 2021  /lib/ld-musl-x86_64.so.1 -> x86_64-linux-musl/libc.so*

This Debian system just has both, so you cannot use this to detect musl.

(Similarily, you cannot use this to detect a pure-static musl system;
I’m told the suckless people have interest in these.)

>  |Link statically.
> 
> Nah.  For hello world you mean?

Yes, link the hello world statically so strings will show MUSL_LOCPATH
occurring. You can use -static for this, or the distro is broken.

>   #?0|kent:musl.git$ git grep -i LOCPA master
>   master:WHATSNEW:- MUSL_LOCPATH search was broken with multiple components
>   master:src/locale/locale_map.c: if (!libc.secure) path = getenv("MUSL_LOCPATH");

Yes, this is where it comes from.

> Never heard of it.

It’s probably their equivalent of glibc LOCPATH: a path where a user
can install custom locales into.
See: https://serverfault.com/a/1093896/189656

gl hf,
//mirabilos
-- 
Infrastrukturexperte • tarent solutions GmbH
Am Dickobskreuz 10, D-53121 Bonn • http://www.tarent.de/
Telephon +49 228 54881-393 • Fax: +49 228 54881-235
HRB AG Bonn 5168 • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

                        ****************************************************
/⁀\ The UTF-8 Ribbon
╲ ╱ Campaign against      Mit dem tarent-Newsletter nichts mehr verpassen:
 ╳  HTML eMail! Also,     https://www.tarent.de/newsletter
╱ ╲ header encryption!
                        ****************************************************


More information about the openssh-unix-dev mailing list