Diff for /loncom/Attic/lcuseradd between versions 1.6 and 1.7

version 1.6, 2000/10/29 22:52:30 version 1.7, 2000/10/29 23:14:16
Line 20  use strict; Line 20  use strict;
 # Second line is PASSWORD  # Second line is PASSWORD
 # Third line is PASSWORD  # Third line is PASSWORD
   
   # Valid passwords must consist of the
   # ascii characters within the inclusive
   # range of 0x20 (32) to 0x7E (126).
   # These characters are:
   # SPACE and
   # !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNO
   # PQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
   
   # Valid user names must consist of ascii
   # characters that are alphabetical characters
   # (A-Z,a-z), numeric (0-9), or the underscore
   # mark (_). (Essentially, the perl regex \w).
   
 # Command-line arguments [USERNAME] [PASSWORD] [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 87  my ($username,$password1,$password2)=@in Line 100  my ($username,$password1,$password2)=@in
 $username=~/^(\w+)$/;  $username=~/^(\w+)$/;
 my $safeusername=$1;  my $safeusername=$1;
   
   # Only add user if we can create a brand new home directory (/home/username).
   if (-e "/home/$safeusername") {
       print "Error. User already exists.\n" unless $noprint;
       unlink('/tmp/lock_lcpasswd');
       exit 8;
   }
   
   # Only add user if the two password arguments match.
 if ($password1 ne $password2) {  if ($password1 ne $password2) {
     print "Error. Password mismatch.\n" unless $noprint;      print "Error. Password mismatch.\n" unless $noprint;
     unlink('/tmp/lock_lcpasswd');      unlink('/tmp/lock_lcpasswd');
Line 103  if (system('/usr/sbin/useradd','-c','LON Line 124  if (system('/usr/sbin/useradd','-c','LON
     unlink('/tmp/lock_lcpasswd');      unlink('/tmp/lock_lcpasswd');
     exit 5;      exit 5;
 }  }
   
   # Make www a member of that user group.
 if (system('/usr/sbin/usermod','-G',$safeusername,'www')) {  if (system('/usr/sbin/usermod','-G',$safeusername,'www')) {
     print "Error. Could not make www a member of the group \"$safeusername\".\n" unless $noprint;      print "Error. Could not make www a member of the group \"$safeusername\".\n" unless $noprint;
     unlink('/tmp/lock_lcpasswd');      unlink('/tmp/lock_lcpasswd');
Line 116  if (system('/usr/sbin/usermod','-G',$saf Line 139  if (system('/usr/sbin/usermod','-G',$saf
   
   
   
   
 # ----------------------------------------------------------- have setuid script run as root  # ----------------------------------------------------------- have setuid script run as root
 sub enable_root_capability {  sub enable_root_capability {
     if ($wwwid==$>) {      if ($wwwid==$>) {

Removed from v.1.6  
changed lines
  Added in v.1.7


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>