From f531e1205dd62e1cc647a8e4b2f794657108c070 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 23 Feb 2006 13:49:54 +0000 Subject: use groupmod to change group when renaming a user --- perl-install/any.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'perl-install/any.pm') diff --git a/perl-install/any.pm b/perl-install/any.pm index 99ca76db3..9dca58edd 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -65,7 +65,7 @@ sub create_user { run_program::rooted($::prefix, 'groupadd', '-g', $gid, $u->{name}); } } elsif ($u->{rename_from}) { - run_program::rooted($::prefix, 'groupadd', $u->{name}) and $gid = int getgrnam($u->{name}); + run_program::rooted($::prefix, 'groupmod', '-n', $u->{name}, $u->{rename_from}); } require authentication; @@ -83,7 +83,7 @@ sub create_user { my (undef, undef, $uid, $gid, undef, undef, undef, $home) = getpwnam($u->{name}); - if (@existing && $::isInstall && ($uid != $existing[4] || $gid != $existing[5]) || $u->{rename_from}) { + if (@existing && $::isInstall && ($uid != $existing[4] || $gid != $existing[5])) { log::l("chown'ing $home from $existing[4].$existing[5] to $uid.$gid"); require commands; eval { commands::chown_("-r", "$uid.$gid", "$::prefix$home") }; -- cgit v1.2.1