Call setreuid(euid, euid) in csc-chfn and csc-chsh on setup
authorMichael Spang <mspang@uwaterloo.ca>
Sat, 5 May 2007 05:32:16 +0000 (01:32 -0400)
committerMichael Spang <mspang@uwaterloo.ca>
Sat, 5 May 2007 05:33:05 +0000 (01:33 -0400)
This fixes an important bug in these utilities, in that
they didn't actually work for regular users.

bin/csc-chfn
bin/csc-chsh

index 4b6be80..f723984 100755 (executable)
@@ -74,6 +74,9 @@ def main():
 
     pwuid, pwnam = whoami()
 
+    euid = os.geteuid()
+    os.setreuid(euid, euid)
+
     gecos_params = {}
 
     try:
index ef0db49..25013a1 100755 (executable)
@@ -55,6 +55,9 @@ def main():
 
     pwuid, pwnam = whoami()
 
+    euid = os.geteuid()
+    os.setreuid(euid, euid)
+
     try:
         options, arguments = getopt.gnu_getopt(sys.argv[1:], 's:')
         new_shell = None