• Bug#1109329: deluser: can't remove user from group with hyphen in the n

    From =?utf-8?q?Dagfinn_Ilmari_Manns=C3=A@21:1/5 to All on Tue Jul 15 12:20:01 2025
    Package: adduser
    Version: 3.152
    Severity: important
    X-Debbugs-Cc: [email protected]

    Dear Maintainer,

    When trying to remove myself from the systemd-journal group with the command

    sudo deluser ilmari systemd-journal

    I get the error:

    invalid characters in input string, see trace output for more details at /usr/share/perl5/Debian/AdduserCommon.pm line 143.

    If I run it again with --stderrmsglevel trace, it looks like there's an extra round of `sanitize_string` with the default pattern happening:

    trace: process names ilmari
    trace: sanitize_string ilmari against (?^aa:^([^-+~:,\s/][^:,\s/]*)$)
    trace: sanitize_string returning ilmari
    trace: process names systemd-journal
    trace: sanitize_string systemd-journal against (?^aa:^([^-+~:,\s/][^:,\s/]*)$) trace: sanitize_string returning systemd-journal
    trace: sanitize_string ilmari against (?^u:[a-zA-Z0-9 _]*)
    trace: sanitize_string returning ilmari
    trace: sanitize_string systemd-journal against (?^u:[a-zA-Z0-9 _]*)

    Comparing that to the output from adding a user to the same group, that only does the first round of sanitation, against the more relaxed pattern.

    -- System Information:
    Debian Release: 13.0
    APT prefers testing-security
    APT policy: (500, 'testing-security'), (500, 'testing')
    Architecture: arm64 (aarch64)

    Kernel: Linux 6.12.35+deb13-arm64 (SMP w/2 CPU threads)
    Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
    Shell: /bin/sh linked to /usr/bin/dash
    Init: systemd (via /run/systemd/system)
    LSM: AppArmor: enabled

    Versions of packages adduser depends on:
    ii passwd 1:4.17.4-2

    adduser recommends no packages.

    Versions of packages adduser suggests:
    ii cron 3.0pl1-197
    ii liblocale-gettext-perl 1.07-7+b1
    ii perl 5.40.1-5
    pn quota <none>

    -- no debconf information

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marc Haber@21:1/5 to All on Wed Jul 16 17:20:01 2025
    Control: tags -1 confirmed
    Control: retitle -1 deluser user group does not work for group names with hyphens
    thanks

    On Tue, Jul 15, 2025 at 11:13:14AM +0100, Dagfinn Ilmari Mannsåker wrote:
    When trying to remove myself from the systemd-journal group with the command

    sudo deluser ilmari systemd-journal

    I get the error:

    invalid characters in input string, see trace output for more details at /usr/share/perl5/Debian/AdduserCommon.pm line 143.

    Thanks for spotting this. I confirm this bug to be present in trixie.
    I'm most probably not going to fix that in trixie since the release is
    too far by now. I do not consider this release-critial.

    It will be fixed early in the forky cycle. A workarond is to use a
    different tool for the time being.

    Greetings
    Marc

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