summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-06-01 07:59:44 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-06-01 07:59:44 +0000
commit6972f7d8826f69437d0e8a502f84f401621872bc (patch)
tree82986ba7de6b6e86aa930b873bd1a9398dbf79fd /perl-install
parent18d7729d575ad2e0b1e8a656a2b395310f38c636 (diff)
downloaddrakx-6972f7d8826f69437d0e8a502f84f401621872bc.tar
drakx-6972f7d8826f69437d0e8a502f84f401621872bc.tar.gz
drakx-6972f7d8826f69437d0e8a502f84f401621872bc.tar.bz2
drakx-6972f7d8826f69437d0e8a502f84f401621872bc.tar.xz
drakx-6972f7d8826f69437d0e8a502f84f401621872bc.zip
allow specifying the uid and gid when creating a user (part of bugzilla #15190)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/any.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 03b1171be..3860c0120 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -613,6 +613,13 @@ sub ask_user_one {
$u->{name} =~ /^[a-z]+?[a-z0-9_-]*?$/ or $in->ask_warn('', N("The user name must contain only lower cased letters, numbers, `-' and `_'")), return 1,0;
length($u->{name}) <= 32 or $in->ask_warn('', N("The user name is too long")), return 1,0;
member($u->{name}, 'root', map { $_->{name} } @$users) and $in->ask_warn('', N("This user name has already been added")), return 1,0;
+ foreach ([ $u->{uid}, N("User ID") ],
+ [ $u->{gid}, N("Group ID") ]) {
+ my ($id, $name) = @$_;
+ $id or next;
+ $id =~ /^\d+$/ or $in->ask_warn('', N("%s must be a number", $name)), return 1;
+ $id >= 500 or $in->ask_yesorno('', N("%s should be above 500. Accept anyway?", $name)) or return 1;
+ }
return 0;
};
my $ret = $in->ask_from_(
@@ -637,6 +644,8 @@ sub ask_user_one {
{ label => N("Password"),val => \$u->{password}, hidden => 1 },
{ label => N("Password (again)"), val => \$u->{password2}, hidden => 1 },
{ label => N("Shell"), val => \$u->{shell}, list => [ shells() ], not_edit => !$::expert, advanced => 1 },
+ { label => N("User ID"), val => \$u->{uid}, advanced => 1 },
+ { label => N("Group ID"), val => \$u->{gid}, advanced => 1 },
if_($security <= 3 && !$options{noicons} && @icons,
{ label => N("Icon"), val => \ ($u->{icon} ||= 'default'), list => \@icons, icon2f => \&face2png, format => \&translate },
),