version 1.15, 2001/10/23 03:42:30
|
version 1.16, 2001/11/15 19:08:00
|
Line 1
|
Line 1
|
#!/usr/bin/perl |
#!/usr/bin/perl |
|
|
|
# The Learning Online Network with CAPA |
# |
# |
# lcuseradd |
# lcuseradd - LON-CAPA setuid script to coordinate all actions |
|
# with adding a user with filesystem privileges (e.g. author) |
# |
# |
# Scott Harrison |
# YEAR=2000 |
# SH: October 27, 2000 |
# 10/27,10/29,10/30 Scott Harrison |
# SH: October 29, 2000 |
|
# YEAR=2001 |
# YEAR=2001 |
# Scott Harrison 10/21 |
# 10/21,11/13,11/15 Scott Harrison |
|
# |
|
# $Id$ |
|
### |
|
|
############################################################################### |
############################################################################### |
## ## |
## ## |
Line 103 use strict;
|
Line 108 use strict;
|
# Security |
# Security |
$ENV{'PATH'}='/bin/:/usr/bin:/usr/local/sbin:/home/httpd/perl'; # Nullify path |
$ENV{'PATH'}='/bin/:/usr/bin:/usr/local/sbin:/home/httpd/perl'; # Nullify path |
# information |
# information |
$ENV{'BASH_ENV'}=""; # Nullify shell environment information. |
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; # nullify potential taints |
|
|
# Do not print error messages. |
# Do not print error messages. |
my $noprint=1; |
my $noprint=1; |
Line 206 if (system('/usr/sbin/usermod','-G',$saf
|
Line 211 if (system('/usr/sbin/usermod','-G',$saf
|
|
|
unlink('/tmp/lock_lcpasswd'); |
unlink('/tmp/lock_lcpasswd'); |
&disable_root_capability; |
&disable_root_capability; |
($>,$<)=(500,500); |
($>,$<)=($wwwid,$wwwid); |
open OUT,"|lcpasswd"; |
open OUT,"|/home/httpd/perl/lcpasswd"; |
print OUT $safeusername; |
print OUT $safeusername; |
print OUT "\n"; |
print OUT "\n"; |
print OUT $password1; |
print OUT $password1; |
Line 215 print OUT "\n";
|
Line 220 print OUT "\n";
|
print OUT $password1; |
print OUT $password1; |
print OUT "\n"; |
print OUT "\n"; |
close OUT; |
close OUT; |
($>,$<)=(500,0); |
($>,$<)=($wwwid,0); |
if ($?) { |
if ($?) { |
exit 8; |
exit 8; |
} |
} |
Line 316 sub try_to_lock {
|
Line 321 sub try_to_lock {
|
close LOCK; |
close LOCK; |
return 1; |
return 1; |
} |
} |
|
|
|
=head1 NAME |
|
|
|
lcuseradd - LON-CAPA setuid script to coordinate all actions |
|
with adding a user with filesystem privileges (e.g. author) |
|
|
|
=head1 DESCRIPTION |
|
|
|
lcuseradd - LON-CAPA setuid script to coordinate all actions |
|
with adding a user with filesystem privileges (e.g. author) |
|
|
|
=head1 README |
|
|
|
lcuseradd - LON-CAPA setuid script to coordinate all actions |
|
with adding a user with filesystem privileges (e.g. author) |
|
|
|
=head1 PREREQUISITES |
|
|
|
=head1 COREQUISITES |
|
|
|
=pod OSNAMES |
|
|
|
linux |
|
|
|
=pod SCRIPT CATEGORIES |
|
|
|
LONCAPA/Administrative |
|
|
|
=cut |