Package: adduser
Version: 3.134
Severity: wishlist
Tags: patch
Hello dear adduser maintainer(s),
I swear, *every* time I do `adduser user group` I have
to look up on the internet how to make that group available
to that user in a running shell session...
The attached patch adds two phrases to the "Add an existing user
to an existing group" paragraph that tells the reader to use
`newgrp` to achieve that and mentions `newgrp` in the
"SEE ALSO" section.
I'd be glad if you could include this in the man page so I
(and probably others) can stop looking it up on the internet
each time...
Best greetings and thank you for your work on `adduser`.
*t
-- System Information:
Debian Release: 12.10
APT prefers stable-security
APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.1.0-32-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=de_CH.UTF-8, LC_CTYPE=de_CH.UTF-8 (charmap=UTF-8), LANGUAGE=de_CH:de
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.13+dfsg1-1+b1
adduser recommends no packages.
Versions of packages adduser suggests:
ii cron 3.0pl1-162
ii liblocale-gettext-perl 1.07-5
ii perl 5.36.0-7+deb12u2
pn quota <none>
-- debconf information excluded
--- adduser-3.150/doc/adduser.8 2025-03-28 14:21:07.000000000 +0100 >+++ adduser-3.150-new/doc/adduser.8 2025-04-21 14:32:25.573790916 +0200
@@ -293,6 +293,11 @@
If called with two non-option arguments,
\fBadduser\fP will add an existing user to an existing group.
+The group will only be available to a user in a new shell
+session. If you need the group to be immediately available
+to a user in a shell session, then execute \fBnewgrp group\fP
+or \fBnewgrp -\fP in that user's shell session.
+
.SH OPTIONS
Different modes of \fBadduser\fP allow different options.
If no valid modes are listed for a option,
@@ -781,6 +786,7 @@
.BR adduser.conf (5),
.BR deluser (8),
.BR groupadd (8),
+.BR newgrp (1),
.BR useradd (8),
.BR usermod (8),
.BR /usr/share/doc/base-passwd/users-and-groups.html
I am totally not sure whether this is appropriate. I agree that this behavior is a quick of many operating systems, but I don't think that adduser should begin to document operating system quirks. People might see this as an issue in adduser, which it isn't.
On Mon, Apr 21, 2025 at 02:44:35PM +0200, Tomas Pospisek wrote:
Package: adduser
Version: 3.134
Severity: wishlist
Tags: patch
Hello dear adduser maintainer(s),
I swear, *every* time I do `adduser user group` I have
to look up on the internet how to make that group available
to that user in a running shell session...
The attached patch adds two phrases to the "Add an existing user
to an existing group" paragraph that tells the reader to use
`newgrp` to achieve that and mentions `newgrp` in the
"SEE ALSO" section.
I'd be glad if you could include this in the man page so I
(and probably others) can stop looking it up on the internet
each time...
Best greetings and thank you for your work on `adduser`.
*t
-- System Information:
Debian Release: 12.10
APT prefers stable-security
APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.1.0-32-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=de_CH.UTF-8, LC_CTYPE=de_CH.UTF-8 (charmap=UTF-8),
LANGUAGE=de_CH:de
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.13+dfsg1-1+b1
adduser recommends no packages.
Versions of packages adduser suggests:
ii cron 3.0pl1-162
ii liblocale-gettext-perl 1.07-5
ii perl 5.36.0-7+deb12u2
pn quota <none>
-- debconf information excluded
--- adduser-3.150/doc/adduser.8 2025-03-28 14:21:07.000000000 +0100
+++ adduser-3.150-new/doc/adduser.8 2025-04-21 14:32:25.573790916 +0200
@@ -293,6 +293,11 @@
If called with two non-option arguments,
\fBadduser\fP will add an existing user to an existing group.
+The group will only be available to a user in a new shell
+session. If you need the group to be immediately available
+to a user in a shell session, then execute \fBnewgrp group\fP
+or \fBnewgrp -\fP in that user's shell session.
+
.SH OPTIONS
Different modes of \fBadduser\fP allow different options.
If no valid modes are listed for a option,
@@ -781,6 +786,7 @@
.BR adduser.conf (5),
.BR deluser (8),
.BR groupadd (8),
+.BR newgrp (1),
.BR useradd (8),
.BR usermod (8),
.BR /usr/share/doc/base-passwd/users-and-groups.html
-- ----------------------------------------------------------------------------- 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
On Mon, 21 Apr 2025, Marc Haber wrote:
I am totally not sure whether this is appropriate. I agree that this >>behavior is a quick of many operating systems, but I don't think
that adduser should begin to document operating system quirks.
People might see this as an issue in adduser, which it isn't.
Well, I mean the goal of "adduser user group" is to add a user to a
group... except that - it doesn't. As a user of adduser I'm not really >interested who's fault it is - I just want to get the job done.
At some point I have somehow found out that using some other magic in >addition is necessary. Other users of adduser might not know and just
think that `adduser user group` doesn't work or is broken or ...
So why not give the user a hand to get the job done?
On Tue, Apr 22, 2025 at 09:54:54AM -0400, Jason Franklin wrote:
At some point I have somehow found out that using some other magic in
addition is necessary. Other users of adduser might not know and just think >>> that `adduser user group` doesn't work or is broken or ...
I actually wouldn't rely on "newgrp" too much for this purpose. It may
not work the way you think.
To follow up on what I said here, I also want to address the patch you provided as this may be different than what you think as well.
If you do…
# adduser foo bar
… you have added user "foo" to group "bar" where the latter is now
a supplementary group for the former (i.e., you've updated system
records).
If the user now runs "newgrp bar", the user will assume "bar" as their primary group. This is ~not~ the same as having the group appended to
their supplementary groups in their current shell session.
There are other differences, but "log out & log in" remains the best and
most complete and correct advice for this situation. It provides the
most predictable result for the user.
Marc, do you think this is reasonable?
On Tue, Apr 22, 2025 at 12:18:42PM -0400, Jason Franklin wrote:
Marc, do you think this is reasonable?
I am still not a fan. That additional language needs to be maintained, translated, proofread, and discussed. I'd rather not having to do that.
"The added group will not be visible in current user sessions"
Is that an acceptable compromise between "the user is left completely
in the dark" and "maintaining additional words adds too much of a
workload"?
*t
On Wed, Apr 23, 2025 at 12:01:45PM +0200, Tomas Pospisek wrote:
"The added group will not be visible in current user sessions"
There will be a bug report "please make added groups visible in current user sessions" since this sentence suggests that it's a design decision in adduser.
Is that an acceptable compromise between "the user is left completely in
the dark" and "maintaining additional words adds too much of a workload"?
"Leaving people in the dark" is suggesting that the adduser maintainers act in bad faith. We Don't.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 480 |
Nodes: | 16 (2 / 14) |
Uptime: | 06:08:12 |
Calls: | 9,535 |
Calls today: | 3 |
Files: | 13,653 |
Messages: | 6,138,724 |
Posted today: | 1 |