summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-07-06 12:45:27 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-07-06 12:45:27 +0000
commitda8f1b4eec83bef9ee10b63cf258c53229544d52 (patch)
treea9d724d1b4530938f4239b1eb40da79dfa924ad8
parenta698efb76706f47b014f54e52337b88d7f895e88 (diff)
downloaddrakx-da8f1b4eec83bef9ee10b63cf258c53229544d52.tar
drakx-da8f1b4eec83bef9ee10b63cf258c53229544d52.tar.gz
drakx-da8f1b4eec83bef9ee10b63cf258c53229544d52.tar.bz2
drakx-da8f1b4eec83bef9ee10b63cf258c53229544d52.tar.xz
drakx-da8f1b4eec83bef9ee10b63cf258c53229544d52.zip
(ask_users): the user name length must be <= 32
-rw-r--r--perl-install/any.pm1
1 files changed, 1 insertions, 0 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 8d7d18365..6b0d22a9f 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -777,6 +777,7 @@ sub ask_users {
$security > 3 && length($u->{password}) < 6 and $in->ask_warn('', _("This password is too simple")), return (1,2);
$u->{name} or $in->ask_warn('', _("Please give a user name")), return (1,0);
$u->{name} =~ /^[a-z0-9_-]+$/ or $in->ask_warn('', _("The user name must contain only lower cased letters, numbers, `-' and `_'")), return (1,0);
+ length($u->{name}) <= 32 or $in->ask_warn('', _("The user name is too long")), return (1,0);
member($u->{name}, map { $_->{name} } @$users) and $in->ask_warn('', _("This user name is already added")), return (1,0);
return 0;
};