# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: adduser.perl,v 1.16 1996/08/28 17:54:14 adam Exp $
+# $Id: adduser.perl,v 1.22 1996/12/07 21:25:12 ache Exp $
# read variables
print "User $p_username: illegal shell: ``$sh''\n"
if ($verbose && $sh &&
!$shell{&basename($sh)} &&
- $p_username !~ /^(bin|uucp|falcon|nobody)$/ &&
+ $p_username !~ /^(news|xten|bin|nobody|uucp)$/ &&
$sh !~ /\/(pppd|sliplogin)$/);
$uid{$p_uid} = $p_username;
$pwgid{$p_gid} = $p_username;
local($name);
while(1) {
- $name = &confirm_list("Enter username", 1, "a-z0-9", "");
- if (length($name) > 8) {
- warn "Username is longer than 8 chars\a\n";
+ $name = &confirm_list("Enter username", 1, "A-Za-z0-9_", "");
+ if (length($name) > 16) {
+ warn "Username is longer than 16 chars\a\n";
next;
}
last if (&new_users_name_valid($name) eq $name);
$groupmembers{$gid} .= "," if $groupmembers{$gid};
$groupmembers{$gid} .= "$name";
+ local(@l) = split(',', $groupmembers{$gid});
+ # group(5): A group cannot have more than 200 members.
+ # The maximum line length of /etc/group is 1024 characters.
+ # Longer lines will be skiped.
+ if ($#l >= 200 ||
+ length($groupmembers{$gid}) > 1024 - 50) { # 50 is for group name
+ warn "WARNING, maybe group line ``$gid{$gid}'' is to long or to\n" .
+ "much users in group, see group(5)\a\n";
+ }
return $name;
}
system("$pwd_mkdb $etc_passwd");
if ($?) {
- local($crash) = "$etc_passwd.crash$$";
warn "$last\n";
- warn "``$pwd_mkdb'' failed, try to restore ...\n";
-
- open(R, "> $crash") || die "Sorry, give up\n";
- $j = join("\n", @passwd_backup);
- $j =~ s/\n//;
- print R $j . "\n";
- close R;
-
- system("$pwd_mkdb $crash");
- die "Sorry, give up\n" if $?;
- die "Successfully restore $etc_passwd. Exit.\n";
+ warn "``$pwd_mkdb'' failed\n";
+ exit($? >> 8);
}
}
[-message message_file]
[-noconfig]
[-shell shell]
- [-s|-silent|-q|-quit]
+ [-s|-silent|-q|-quiet]
[-uid uid_start]
[-v|-verbose]
shift @argv;
last if /^--$/;
if (/^--?(v|verbose)$/) { $verbose = 1 }
- elsif (/^--?(s|silent|q|quit)$/) { $verbose = 0 }
+ elsif (/^--?(s|silent|q|quiet)$/) { $verbose = 0 }
elsif (/^--?(debug)$/) { $verbose = 2 }
elsif (/^--?(h|help|\?)$/) { &usage }
elsif (/^--?(home)$/) { $home = $argv[0]; shift @argv }
\$fullname,
-your account ``\$name'' was created. Your password is ``\$password''.
-Please expire your password. Have fun!
+your account ``\$name'' was created.
+Have fun!
See also chpass(1), finger(1), passwd(1)
EOF