Paul Eggert <[email protected]> writes:

> On 2026-07-16 07:40, Luca Boccassi wrote:
>> It is clearly not mandatory functionality, as the package works just
>> fine without it, minus some optional features that are seldomly
>> needed.
>
> If 'who' always fails, is coreutils working "just fine"? I used "who"
> before reading your email this morning (to look into a problem
> involving authentication and backups), and if 'who' had failed due to
> a missing library I would not have said coreutils is working "just
> fine".

I agree.

The patch uses SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED for
libsystemd. 
https://uapi-group.org/specifications/specs/elf_dlopen_metadata/#priority-definition
says..

* required      Core functionality needs the dependency, the binary will
                not work if it cannot be found
* recommended   Important functionality needs the dependency, the binary
                will work but in most cases the dependency should be provided

It is the entire point of 'who', hence it should be 'required' if dlopen
is to be used at all.

>
> That being said, to cater to a user population that thinks coreutils
> works "just fine" even if 'who' always fails, how about if we instead
> look into another idea that I think was briefly mentioned earlier:
> namely, packagers run a shell command "optional-libsystemd who pinky
> users", where optional-libsystemd is something like the attached
> script.
>
> The optional-libsystemd script could be generalized to do something
> similar for other dynamic libraries that have this issue. (As an
> aside, it is annoying that objcopy makes this sort of thing such a
> pain but perhaps objcopy could be improved to make it easier.)
>
> Although the script puts a bit of the burden on the packagers, the
> feature's burden must go *somewhere*, and since packagers want the
> feature they are more likely to maintain it well.

Not all packagers want this. I consider this undesirable where we know
we will be deployed on a system that, say, uses SELinux. systemd
currently as of bda98358d29336b285450c6d3e2c9d6a634efddd will do:

int dlopen_libselinux(int log_level) {
#if HAVE_SELINUX
        static void *libselinux_dl = NULL;

        LIBSELINUX_NOTE(suggested);

i.e. if you build systemd with libselinux support, it is merely
'suggested', yet if you rely on SELinux support, that's not the case at
all.

'suggested' is subjective and depends on if you know where it is going
to be deployed.

thanks,
sam

Attachment: signature.asc
Description: PGP signature

Reply via email to