Project

General

Profile

Bug #8553

Creating a user as a member of a group fails to add that group to the user

Added by Jim Pingle 10 months ago. Updated 8 months ago.

Status:
Resolved
Priority:
Normal
Category:
User manager
Target version:
Start date:
06/06/2018
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.4.x
Affected Architecture:
All

Description

When creating a user, if a group is selected during account creation, the group is not added to the user at the OS level, and an error is logged:

/system_usermanager.php: The command '/usr/sbin/pw groupmod -l 'admins' -g '1999' -M '0,2020' 2>&1' returned exit code '67', the output was 'pw: user `2020' does not exist'

It would appear the sync process is attempting to add the user to the group before the user exists in a way visible to pw.

This group will not appear on the user in the OS until after a reboot, or after the group is removed and added again.

Adding a group to an existing user works and does not produce an error.

History

#1 Updated by Jens Groh 10 months ago

Jim Pingle: pardon me for jumping in, but is that happening only on the slave via XMLRPC or is that happening on the master? We were encountering a problem that the sudo package won't recognize users being in the admins group when those were added after the sudo package installation. Users installed before (or I think before a reboot) could 'sudo' correclty while newly created ones get the "sudo blah incident reported ;)" message. Could that perhaps be related to this? If you don't think so, should I open a bug here or elsewhere for the sudo package?

#2 Updated by Jim Pingle 10 months ago

It's happening on a standalone system, not XMLRPC. Presumably it would also happen on a master if the same situation happened.

It's easy to reproduce, just make a user and add a group during the creation step. You'll see the error and if you check id <username> it won't show them in the group. You can also check the groups file and so on. If you create the user without a group, then edit again and add the group, that works OK and it shows everywhere. It also fixes itself during a full user resync like what happens during a reboot.

#3 Updated by Renato Botelho 8 months ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

#4 Updated by Jim Pingle 8 months ago

  • Status changed from Feedback to Resolved

Error is gone and user is a member of the group after creation. Looks good to me.

Also available in: Atom PDF