]> git.ipfire.org Git - thirdparty/shadow.git/commit
usermod: respect --prefix for --gid option
authorMike Gilbert <floppym@gentoo.org>
Sun, 26 Mar 2023 01:16:55 +0000 (21:16 -0400)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Wed, 29 Mar 2023 07:05:23 +0000 (09:05 +0200)
commitbd2d0079c90241f24671a7946a3ad175dc1a3aeb
tree32d81cf2efa3b2380d24e3fdfa3fe847d74a66dc
parent4c210a29bc57d584db4e69a28d27fee8d75956cc
usermod: respect --prefix for --gid option

The --gid option accepts a group name or id. When a name is provided, it
is resolved to an id by looking up the name in the group database
(/etc/group).

The --prefix option overides the location of the passwd and group
databases. I suspect the --gid option was overlooked when wiring up the
--prefix option.

useradd --gid already respects --prefix; this change makes usermod
behave the same way.

Fixes: b6b2c756c91806b1c3e150ea0ee4721c6cdaf9d0
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
src/usermod.c