--- loncom/lcuserdel 2000/10/30 03:08:28 1.11 +++ loncom/lcuserdel 2002/10/07 01:52:28 1.14 @@ -114,20 +114,21 @@ if ($username ne $safeusername) { # Remove entry from /etc/passwd if it exists # Remove entry from /etc/groups if it exists # 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/userdel 2>/dev/null',$safeusername); # ignore error message -system('/usr/sbin/groupdel 2>/dev/null',$safeusername); # ignore error message +system('/usr/sbin/groupdel',$safeusername); # ignore error message +system('/usr/sbin/userdel',$safeusername); # ignore error message +system('/usr/sbin/groupdel',$safeusername); # ignore error message # Remove entry from /etc/smbpasswd if it exists -my $oldsmbpasswd=`/bin/cat /etc/smbpasswd`; -my $newsmbpasswd=`/bin/grep -v '^${safeusername}:' /etc/smbpasswd`; - -if ($oldsmbpasswd ne $newsmbpasswd) { - open OUT,">/etc/smbpasswd"; - print OUT $newsmbpasswd; - close OUT; +# the safest way to do this is with smbpasswd -x +# as that's independent of location of the smbpasswd file. +# +if (-e '/usr/bin/smbpasswd') { + ($>,$<) = (0,0); # fool smbpasswd to think this is not setuid. + system('/usr/bin/smbpasswd -x '.$safeusername); + $< = $wwwid; } + # Change ownership on directory from username:username to www:www # This prevents subsequently added users from having access. 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.