• Bug#1104496: debian-reference: incorrect usage of usermod in chapter 5

    From g1@21:1/5 to All on Thu May 1 11:10:01 2025
    This is a multi-part MIME message sent by reportbug.


    Package: debian-reference
    Version: 2.127
    Severity: normal
    Tags: patch

    The command
    $ sudo usermod -a -G foo netdev
    tries to add user "netdev" to group "foo", and is bound to fail.

    The correct syntax for adding user <user> to (supplementary) group <group> is
    # usermod -a -G <group> <user>

    The mistake is visible online at <https://www.debian.org/doc/manuals/debian-reference/ch05.en.html>.
    It's present in source package versions 2.125 and 2.127.

    Best regards,
    g.

    -- System Information:
    Debian Release: 12.10
    APT prefers stable-updates
    APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
    Architecture: amd64 (x86_64)

    Kernel: Linux 6.1.0-34-amd64 (SMP w/12 CPU threads; PREEMPT)
    Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
    Shell: /bin/sh linked to /usr/bin/dash
    Init: sysvinit (via /sbin/init)
    LSM: AppArmor: enabled

    Versions of packages debian-reference depends on:
    pn debian-reference-en <none>

    Versions of packages debian-reference recommends:
    pn debian-reference-de <none>
    pn debian-reference-es <none>
    pn debian-reference-fr <none>
    pn debian-reference-id <none>
    pn debian-reference-it <none>
    pn debian-reference-ja <none>
    pn debian-reference-pt <none>
    pn debian-reference-zh-cn <none>
    pn debian-reference-zh-tw <none>

    debian-reference suggests no packages.

    --- 05_network_setup.rawxml 2025-05-01 10:35:05.528712579 +0200
    +++ 05_network_setup.rawxml.new 2025-05-01 10:28:45.619110419 +0200
    @@ -353,7 +353,7 @@
    <orderedlist>
    <listitem>
    <para> Make desktop user, e.g. <literal>foo</literal>, belong to group "<literal>netdev</literal>" by the following (Alternatively, do it automatically via <ulink url="https://en.wikipedia.org/wiki/D-Bus">D-bus</ulink> under modern desktop
    environments such as GNOME and KDE). </para>
    - <screen>$ sudo usermod -a -G foo netdev</screen>
    + <screen>$ sudo usermod -a -G netdev foo</screen>
    </listitem>
    <listitem>
    <para> Keep configuration of "<literal>/etc/network/interfaces</literal>" as simple as in the following. </para>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Holger Wansing@21:1/5 to All on Thu May 1 12:50:02 2025
    Hi,

    Am 1. Mai 2025 10:56:16 MESZ schrieb g1 <g1pi@libero.it>:

    The command
    $ sudo usermod -a -G foo netdev
    tries to add user "netdev" to group "foo", and is bound to fail.

    The correct syntax for adding user <user> to (supplementary) group <group> is
    # usermod -a -G <group> <user>

    The text says
    "Make desktop user, e.g. foo, belong to group "netdev" by the following:"

    So you are right, the example is wrong, the <user> argument has to be the last one, like this:


    - $ sudo usermod -a -G foo netdev
    + $ sudo usermod -a -G netdev foo



    Holger





    --
    Sent from /e/ OS on Fairphone3

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Osamu Aoki@21:1/5 to Holger Wansing on Thu May 1 17:10:02 2025
    Control: tags -1 pending

    Thanks

    I committed to salsa


    On Thu, 2025-05-01 at 12:46 +0200, Holger Wansing wrote:
    Hi,

    Am 1. Mai 2025 10:56:16 MESZ schrieb g1 <g1pi@libero.it>:

    The command
       $ sudo usermod -a -G foo netdev
    tries to add user "netdev" to group "foo", and is bound to fail.

    The correct syntax for adding user <user> to (supplementary) group <group> is
       # usermod -a -G <group> <user>

    The text says
    "Make desktop user, e.g. foo, belong to group "netdev" by the following:"

    So you are right, the example is wrong, the <user>  argument has to be the last one, like this:


    - $ sudo usermod -a -G foo netdev
    + $ sudo usermod -a -G netdev foo



    Holger






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