[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

mock mock.py,1.8,1.9



Author: katzj

Update of /cvs/fedora/mock
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16319

Modified Files:
	mock.py 
Log Message:
don't allow running as root (#159986)



Index: mock.py
===================================================================
RCS file: /cvs/fedora/mock/mock.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- mock.py	12 Jun 2005 23:33:30 -0000	1.8
+++ mock.py	12 Jun 2005 23:35:39 -0000	1.9
@@ -586,6 +586,11 @@
     if not member:
         print "You need to be a member of the mock group for this to work"
         sys.exit(1)
+
+    # and make sure they're not root
+    if os.geteuid() == 0:
+        error("Don't try to run mock as root!")
+        sys.exit(1)
         
     # config path
     config_path='/etc/mock'
@@ -632,6 +637,7 @@
     hdr = rpmUtils.miscutils.hdrFromPackage(ts, srpm)
     if hdr[rpm.RPMTAG_SOURCEPACKAGE] != 1:
         error("Specified srpm isn't a srpm!  Can't go on")
+        sys.exit(50)
     
     # read in the config file by chroot name
     if options.chroot.endswith('.cfg'):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]