adduser doesn't support extrausers for group management

Bug #1978042 reported by Robert Ancell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
adduser (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Won't Fix
Medium
Unassigned
Impish
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned
Kinetic
Fix Released
Undecided
Unassigned
shadow (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Won't Fix
Medium
Unassigned
Impish
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned
Kinetic
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

When using adduser --extrausers on Ubuntu Core the command attempts to use the /etc/group file instead of /var/lib/extrausers/group. e.g. the following commands will fail:

$ adduser --extrausers user group
$ adduser --extrausers --ingroup group user

[Test Plan]

1. Install libnss-extrausers
2. Edit /etc/nsswitch.conf to use extrausers as shown in /usr/share/doc/libnss-extrausers/README
3. Add a new group:
$ sudo adduser --extrausers --group test-group
4. Create a new user with this group:
$ sudo adduser --extrausers --ingroup test-group test-user1
5. Create a new user and add them to this group:
$ sudo adduser --extrausers test-user2
$ sudo adduser --extrausers test-user2 test-group

Expected result:
Two new users (test-user1 and test-user2) are successfully added to the system and are entered in /var/lib/extrausers/{passwd,shadow}.
A new group (test-group) is successfully added to /var/lib/extrausers/group and contains the new users.

[Where problems could occur]
Existing users of adduser and gpasswd that don't use --extrausers are unlikely to hit any issues, as their codepath is unchanged.
Existing users that use --extrausers will have a behavior change, but the existing behavior was to fail so this is unlikely to introduce any new issues.
There is the risk of introducing new bugs by this change, but it has used since impish without any issues being detected.

Changed in adduser (Ubuntu Impish):
status: New → Fix Released
Changed in adduser (Ubuntu Jammy):
status: New → Fix Released
Changed in adduser (Ubuntu Kinetic):
status: New → Fix Released
Changed in shadow (Ubuntu Impish):
status: New → Fix Released
Changed in shadow (Ubuntu Jammy):
status: New → Fix Released
Changed in shadow (Ubuntu Kinetic):
status: New → Fix Released
Changed in shadow (Ubuntu Focal):
importance: Undecided → Medium
Changed in adduser (Ubuntu Focal):
importance: Undecided → Medium
Revision history for this message
Alex Murray (alexmurray) wrote (last edit ):

This looks like a duplicate of LP: #1959375

Revision history for this message
Robert Ancell (robert-ancell) wrote :

LP: #195375 adds extrausers groups support to the usermod command, this SRU adds support to gpasswd (which is used by useradd).

Revision history for this message
Robert Ancell (robert-ancell) wrote :
Revision history for this message
Robert Ancell (robert-ancell) wrote :
Revision history for this message
Robert Ancell (robert-ancell) wrote :

I realized after generating the debdiffs that I didn't have the bug number in the changelog - this is fixed in the version uploaded to focal.

Changed in adduser (Ubuntu Focal):
status: New → In Progress
Changed in shadow (Ubuntu Focal):
status: New → In Progress
description: updated
description: updated
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Ugh, turns out I don't need to SRU these back to focal - we will be using Ubuntu Core 22 which already includes these changes. Sorry for the noise.

Changed in shadow (Ubuntu Focal):
status: In Progress → Won't Fix
Changed in adduser (Ubuntu Focal):
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.