[LON-CAPA-cvs] cvs: loncom / lcpasswd
foxr
foxr@source.lon-capa.org
Tue, 12 Oct 2010 10:33:47 -0000
foxr Tue Oct 12 10:33:47 2010 EDT
Modified files:
/loncom lcpasswd
Log:
Make this work on fc13.
Index: loncom/lcpasswd
diff -u loncom/lcpasswd:1.21 loncom/lcpasswd:1.22
--- loncom/lcpasswd:1.21 Thu Apr 7 22:27:52 2005
+++ loncom/lcpasswd Tue Oct 12 10:33:47 2010
@@ -7,7 +7,7 @@
# YEAR=2002
# 02/19 Matthew Hall
#
-# $Id: lcpasswd,v 1.21 2005/04/07 22:27:52 albertel Exp $
+# $Id: lcpasswd,v 1.22 2010/10/12 10:33:47 foxr Exp $
###
###############################################################################
@@ -92,15 +92,15 @@
# ----------------------------- Make sure this process is running from user=www
my $wwwid=getpwnam('www');
-&disable_root_capability;
-if ($wwwid!=$>) {
+
+if ($wwwid!=$<) {
print("User ID mismatch. This program must be run as user 'www'\n")
unless $noprint;
exit 1;
}
# ----------------------------------- Start running script with www permissions
-&disable_root_capability;
+
# --------------------------- Handle case of another lcpasswd process (locking)
unless (&try_to_lock('/tmp/lock_lcpasswd')) {
@@ -190,7 +190,7 @@
print "smbpasswd done" unless $noprint;
}
-&disable_root_capability;
+
unlink('/tmp/lock_lcpasswd');
exit 0;
@@ -222,10 +222,7 @@
my ($lockfile)=@_;
my $currentpid;
my $lastpid;
- # Do not manipulate lock file as root
- if ($>==0) {
- return 0;
- }
+
# Try to generate lock file.
# Wait 3 seconds. If same process id is in
# lock file, then assume lock file is stale, and