• Adduser/logger problems in s390x autopkgtest

    From Marc Haber@21:1/5 to All on Sun Jul 9 18:50:01 2023
    [Please cc me and adduser@packages.debian.org on replies, I am not
    subscribed to Debian-s390]

    Hi,

    adduser has just recently (version 3.137) gained the ability of logging
    to syslog. To avoid growing another dependency, adduser uses the perl
    system() function to invoke logger(1) to write to syslog. The
    functionality is on by default and uses the --id=$$ idiom to group all
    log entries generated by a single adduser invocation together.

    This doesn't work when adduser goes through autopkgtest on s390x, see https://ci.debian.net/data/autopkgtest/unstable/s390x/a/adduser/35563060/log.gz

    Every single call to logger(1) causes an "invalid argument" error. This
    can be verified when logging into the lxc container that is used to run
    the autopkgtest on s390x and trying it by hand:

    root@autopkgtest-lxc-vkuuhi:~# logger --id=$$ foo
    logger: send message failed: Invalid argument
    root@autopkgtest-lxc-vkuuhi:~#

    This is evidently caused by the --id=$$ construct as without the $$ it
    works:

    root@autopkgtest-lxc-vkuuhi:~# logger --id foo
    root@autopkgtest-lxc-vkuuhi:~#

    logger's source in util-linux suggests that some special handling is
    done when called with --id=$$ as root, and logger adds in this case
    "local socket credentials" to the sendmsg call used to send the message
    to the log socket, which are evidently rejected by the receiving library.

    This _ONLY_ happens on s390x and is currently keeping adduser 3.137 out
    of testing. Sadly, I do not have "real" root on any s390x system and
    therefore cannot do any more testing. So this might be some weird
    s390x-only namespace or lxc issue or an issue with the autopkgtest setup
    for s390x, but I think that there is nothing that adduser can do here.

    I would rather not ignore this error, since I think that adduser should complain to the user that it cannot log to syslog if it is expected to
    log to syslog. I also think that it is the right thing to do this by
    default. I'd also rather not catch the error from logger and translate
    it to some adduser-specific error message as the logger error message is
    clear and easy to understand, and even adduser's error message would
    make autopkgtest on s390x (and no other architecture) fail.

    I would appreciate if someone with root on an s390x system could
    investigate this, and if necessary get in touch with the people running
    the s390x autopkgtest hosts on ci.debian.net to clean up a possible
    issue that might be present in the autopkgtest setup.

    Adduser's autopkgtests should be run in a container or a throwaway VM
    since they create users, groups and home directories. They need root. I
    myself run adduser's autopkgtest with "autopkgtest . -- null" in a systemd-nspawn container. Adduser's autopkgtests run successfully on ci.debian.net on all architectures other than s390x. adduser is a plain
    perl program, there should be zero portability issues.

    Thanks for helping!

    Greetings
    Marc

    -- ----------------------------------------------------------------------------- Marc Haber | "I don't trust Computers. They | Mailadresse im Header Leimen, Germany | lose things." Winona Ryder | Fon: *49 6224 1600402 Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Wise@21:1/5 to Marc Haber on Mon Jul 10 08:30:01 2023
    On Sun, 2023-07-09 at 18:32 +0200, Marc Haber wrote:

    This doesn't work when adduser goes through autopkgtest on s390x, see https://ci.debian.net/data/autopkgtest/unstable/s390x/a/adduser/35563060/log.gz

    It was mentioned on #debci that this might be the bug here:

    https://github.com/util-linux/util-linux/issues/2336

    logger was using uninitialised memory in the sendmsg calls.

    --
    bye,
    pabs

    https://wiki.debian.org/PaulWise

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEYQsotVz8/kXqG1Y7MRa6Xp/6aaMFAmSro+oACgkQMRa6Xp/6 aaNzZQ/9F2VBL0fBbkGEMGNieTfE5OkPHGFJh9EcuZcdmr7GULw2RnTn495zrhhK x3HMr9SB6GWay+EyQ8peD1ioi/QK8nWUtn72ND8UnZc+ufm8OFFYIc7cEXCeWpbl BkvKETP/hld7ikMYheZbDbudeQVxr7pgtM4j4DWwtd+/rsYIxIiR1jP1h+8CIZvK 3SxtKHSJynNDnCHpG5x+20AXZG0oDasfmqd5GveKJhugko15dC+jNzZK7j3ZSMdv S47aUIzT/wbjH1ernLMWlMPjxvcj0Ex//gkamjhFSmRMVm3036M/+xKN5XkvCW+9 Di98el7DbJhw+S4Erfwl9nMXrm+FLXmpvX/ceDSV2iynamGXp3lLuFL98oQDzU4A daNDd7ZRBJwyRs/NcxhujG+8OVUsfVgEg0ITQg5fNDJmfNcyZVcihe2lPXcKiEEX Z4dzEz23tS6H4Ftr/uQYrAPwIaEhsOKOmhf0w8Rz+5CtIhDPRP8rIat7n46buFxa OAdVOKJUMLqOj6vX7Wqsx1HUWpsa0Vw4cN3nYo/umGElq+hMR5PmNVl8SuRvSVDx qWEcw2fZAtx+l39ysreu6XK7Sl2NwhWodXGeQX2C9TEpWvnRZtGISF9Ty/Ox+VEb Yugnn9UfswzH585UNxKKXSNvgLBqRbwW9PGC/tcYwcqJuGBefG4=
    =lo2z
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)