Diff for /loncom/lcuserdel between versions 1.11 and 1.16

version 1.11, 2000/10/30 03:08:28 version 1.16, 2007/08/22 19:53:22
Line 2 Line 2
 #  #
 # lcuserdel  # lcuserdel
 #  #
 # Scott Harrison  
 # SH: October 27, 2000  
 # SH: October 28, 2000  
 # SH: October 29, 2000  
   
 use strict;  use strict;
   
   # $Id$
   
 # This script is a setuid script (chmod 6755) that should  # This script is a setuid script (chmod 6755) that should
 # be run by user 'www'.  It DOES NOT delete directories.  # be run by user 'www'.  It DOES NOT delete directories.
 # All it does is remove a user's entries from  # All it does is remove a user's entries from
Line 114  if ($username ne $safeusername) { Line 112  if ($username ne $safeusername) {
 # Remove entry from /etc/passwd if it exists  # Remove entry from /etc/passwd if it exists
 # Remove entry from /etc/groups if it exists  # Remove entry from /etc/groups if it exists
 # I surround with groupdel command to make absolutely sure the group definition disappears.  # I surround with groupdel command to make absolutely sure the group definition disappears.
 system('/usr/sbin/groupdel 2>/dev/null',$safeusername); # ignore error message  system('/usr/sbin/groupdel',$safeusername); # ignore error message
 system('/usr/sbin/userdel 2>/dev/null',$safeusername); # ignore error message  system('/usr/sbin/userdel',$safeusername); # ignore error message
 system('/usr/sbin/groupdel 2>/dev/null',$safeusername); # ignore error message  system('/usr/sbin/groupdel',$safeusername); # ignore error message
   
 # Remove entry from /etc/smbpasswd if it exists  # Remove entry from /etc/smbpasswd if it exists
 my $oldsmbpasswd=`/bin/cat /etc/smbpasswd`;  #  the safest way to do this is with smbpasswd -x
 my $newsmbpasswd=`/bin/grep -v '^${safeusername}:' /etc/smbpasswd`;  #  as that's independent of location of the smbpasswd file.
   #
 if ($oldsmbpasswd ne $newsmbpasswd) {  if (-e '/usr/bin/smbpasswd') {
     open OUT,">/etc/smbpasswd";    ($>,$<) = (0,0); # fool smbpasswd to think this is not setuid.
     print OUT $newsmbpasswd;    system('/usr/bin/smbpasswd -x '.$safeusername);
     close OUT;    $< = $wwwid;
 }  }
   
   
 # Change ownership on directory from username:username to www:www  # Change ownership on directory from username:username to www:www
 # This prevents subsequently added users from having access.  # This prevents subsequently added users from having access.
   

Removed from v.1.11  
changed lines
  Added in v.1.16


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