summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2006-02-23 13:49:54 +0000
committerOlivier Blin <oblin@mandriva.org>2006-02-23 13:49:54 +0000
commitf531e1205dd62e1cc647a8e4b2f794657108c070 (patch)
treecc85e1a8172a9f8c1b2f33aa7a2f42407e577704
parent126f3e71b55d5c6478c3ecc9b4429f7932dfe214 (diff)
downloaddrakx-backup-do-not-use-f531e1205dd62e1cc647a8e4b2f794657108c070.tar
drakx-backup-do-not-use-f531e1205dd62e1cc647a8e4b2f794657108c070.tar.gz
drakx-backup-do-not-use-f531e1205dd62e1cc647a8e4b2f794657108c070.tar.bz2
drakx-backup-do-not-use-f531e1205dd62e1cc647a8e4b2f794657108c070.tar.xz
drakx-backup-do-not-use-f531e1205dd62e1cc647a8e4b2f794657108c070.zip
use groupmod to change group when renaming a user
-rw-r--r--perl-install/any.pm4
1 files changed, 2 insertions, 2 deletions
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") };