From 23cb924fbfa4bebd4843cbe61b5c4fe3592c590c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 3 Aug 2012 11:03:56 -0400 Subject: [PATCH] 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. --- modules/config/users-groups.nix | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/modules/config/users-groups.nix b/modules/config/users-groups.nix index 598d68eb91db..76b6c2854a9c 100644 --- a/modules/config/users-groups.nix +++ b/modules/config/users-groups.nix @@ -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 }