mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-20 04:33:57 +00:00
Don't try to change the uid/gid of existing users
Unless we search the entire filesystem to do a chown *and* restart existing processes owned by that user, there is no sensible way that we can change uids/gids. So don't try.
This commit is contained in:
parent
0a0c28f812
commit
23cb924fbf
@ -265,15 +265,11 @@ in
|
||||
oldIFS="$IFS"; IFS=:; set -- $curEnt; IFS="$oldIFS"
|
||||
prevUid=$3
|
||||
prevHome=$6
|
||||
# Don't change the UID if it's the same, otherwise usermod
|
||||
# will complain.
|
||||
if test "$prevUid" = "$uid"; then unset uid; fi
|
||||
# Don't change the home directory if it's the same to prevent
|
||||
# unnecessary warnings about logged in users.
|
||||
if test "$prevHome" = "$home"; then unset home; fi
|
||||
usermod \
|
||||
--comment "$description" \
|
||||
''${uid:+--uid $uid} \
|
||||
--gid "$group" \
|
||||
--groups "$extraGroups" \
|
||||
''${home:+--home "$home"} \
|
||||
@ -296,13 +292,6 @@ in
|
||||
groupadd --system \
|
||||
''${gid:+--gid $gid} \
|
||||
"$name"
|
||||
else
|
||||
#echo "updating group $name..."
|
||||
oldIFS="$IFS"; IFS=:; set -- $curEnt; IFS="$oldIFS"
|
||||
prevGid=$3
|
||||
if test -n "$gid" -a "$prevGid" != "$gid"; then
|
||||
groupmod --gid $gid "$name"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user