version 1.2, 2000/10/29 22:07:20
|
version 1.3, 2000/10/29 22:20:43
|
Line 18 use strict;
|
Line 18 use strict;
|
# Standard input usage |
# Standard input usage |
# First line is USERNAME |
# First line is USERNAME |
# Second line is PASSWORD |
# Second line is PASSWORD |
|
# Third line is PASSWORD |
|
|
# Command-line arguments [USERNAME] [PASSWORD] |
# Command-line arguments [USERNAME] [PASSWORD] [PASSWORD] |
# Yes, but be very careful here (don't pass shell commands) |
# Yes, but be very careful here (don't pass shell commands) |
# and this is only supported to allow perl-system calls. |
# and this is only supported to allow perl-system calls. |
|
|
Line 27 use strict;
|
Line 28 use strict;
|
$ENV{'PATH'}=""; # Nullify path information. |
$ENV{'PATH'}=""; # Nullify path information. |
$ENV{'BASH_ENV'}=""; # Nullify shell environment information. |
$ENV{'BASH_ENV'}=""; # Nullify shell environment information. |
|
|
# Add user entry to /etc/passwd and /etc/groups. |
# Add user entry to /etc/passwd and /etc/groups in such |
|
# a way that www is a member of the user-specific group |
|
|
# Set password with lcpasswd (which creates smbpasswd entry). |
# useradd [-c comment] [-d home_dir] |
|
# [-e expire_date] [-f inactive_time] |
|
# [-g initial_group] [-G group[,...]] |
|
# [-m [-k skeleton_dir] | -M] [-p passwd] |
|
# [-s shell] [-u uid [ -o]] [-n] [-r] login |
|
system('/usr/sbin/useradd','-c','LON-CAPA user','-G','www','junk'); |
|
|
# www becomes member of this user group |
# Set password with lcpasswd (which creates smbpasswd entry). |
|
|