Author: justi9
Date: 2009-08-31 13:13:12 -0400 (Mon, 31 Aug 2009)
New Revision: 3601
Modified:
mgmt/trunk/mint/python/mint/tools.py
Log:
Remove unneccessary command-line options; drop privileges in mint tools
Modified: mgmt/trunk/mint/python/mint/tools.py
===================================================================
--- mgmt/trunk/mint/python/mint/tools.py 2009-08-31 15:57:38 UTC (rev 3600)
+++ mgmt/trunk/mint/python/mint/tools.py 2009-08-31 17:13:12 UTC (rev 3601)
@@ -35,14 +35,6 @@
opt = CommandOption(self, "debug")
opt.description = "Enable debugging; print logging to console"
- opt = CommandOption(self, "expire-frequency")
- opt.argument = "FREQUENCY"
- opt.description = "Frequency (in seconds) of the expiration thread"
-
- opt = CommandOption(self, "expire-threshold")
- opt.argument = "THRESHOLD"
- opt.description = "Threshold (in seconds) of the age of data before it is
expired"
-
def check(self):
if os.getuid() not in (os.stat(__file__).st_uid, 0):
print "Error: You have insufficient privileges"
@@ -51,6 +43,11 @@
def init(self):
super(BaseMintTool, self).init()
+ # Drop privileges
+
+ if os.getuid() == 0:
+ os.setuid(os.stat(__file__).st_uid)
+
try:
import psyco
psyco.full()
Show replies by date