From 49b035b122874fc9038464d220caeef586d9574c Mon Sep 17 00:00:00 2001 From: Joel Andres Granados Date: Wed, 20 Feb 2008 11:44:00 +0100 Subject: Efective user must be root. --- firstaidkit | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'firstaidkit') diff --git a/firstaidkit b/firstaidkit index dda060e..fb5c6bd 100755 --- a/firstaidkit +++ b/firstaidkit @@ -16,8 +16,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -import sys -import getopt +import sys, getopt, os from threading import Thread from pyfirstaidkit import Tasker from pyfirstaidkit import Config @@ -64,8 +63,18 @@ if __name__=="__main__": params, rest = getopt.getopt(sys.argv[1:], "ftc:r:vl:x:F:g:P:h", ["flow", "task", "config=", "root=", "verbose", "log=", "exclude=", "flag=", "gui=", "plugin-path=", "print-config", "help"]) + + # + # Preliminary checks before we parse the options. + # if len(params) == 0: Flags.main_help = True + if os.geteuid() != 0: + # Might want to add the "I want to execute anyway" option. + print "\nYou must be root to execute firstaidkit.\n" + usage(sys.argv[0]) + sys.exit(1) + for key,val in params: if key in ("-t", "--task"): Config.operation.mode = "task" -- cgit