Project

General

Profile

Actions

Bug #8553

closed

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

Added by Jim Pingle over 6 years ago. Updated over 6 years ago.

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

100%

Estimated time:
Plus Target Version:
Release Notes:
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.

Actions #1

Updated by Jens Groh over 6 years 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?

Actions #2

Updated by Jim Pingle over 6 years 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.

Actions #3

Updated by Renato Botelho over 6 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100
Actions #4

Updated by Jim Pingle over 6 years ago

  • Status changed from Feedback to Resolved

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

Actions

Also available in: Atom PDF