diff --git a/mkapachepw.py b/mkapachepw.py index 52a1942..ab02738 100755 --- a/mkapachepw.py +++ b/mkapachepw.py @@ -9,7 +9,7 @@ # Program Information PROGNAME = "mkapachepw" -RCSID = "$Id: mkapachepw.py,v 1.109 2005/04/05 20:26:32 root Exp $" +RCSID = "$Id: mkapachepw.py,v 1.110 2005/04/05 20:43:44 root Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -99,7 +99,6 @@ "usage: " + PROGNAME + " [-GUfghuv] where,\n", " -G list of groups to include (+group) or exclude (-group) (default: none)", " -U list of users to include (+user) or exclude (-user) (default: none)", - " -f file configuration file to use (default: none)", " -g # smallest GID to include in output (default: 100)", " -h print this help information", " -u # smallest UID to include in output (default: 100)", @@ -111,8 +110,6 @@ # Global Variables & Data Structures # #----------------------------------------------------------# -CFGFILE = "" # Default is no config file - groups = {} # Place to store group information users = {} # Place to store user information @@ -263,7 +260,7 @@ OPTIONS = envopt.split() + OPTIONS try: - opts, args = getopt.getopt(OPTIONS, '-G:U:f:g:hu:v') + opts, args = getopt.getopt(OPTIONS, '-G:U:g:hu:v') except getopt.GetoptError: Usage() sys.exit(1) @@ -273,15 +270,21 @@ ProcessEnumeratedList(val, groups, grp.getgrgid, "Group") if opt == "-U": ProcessEnumeratedList(val, users, pwd.getpwuid, "User") - if opt == "-f": - CFGFILE=val if opt == "-g": - STARTGID=int(val) + try: + STARTGID=int(val) + except: + ErrorMsg("Invalid Starting GID, '%s' - Must Be An Integer Value." % val) + sys.exit(1) if opt == "-h": Usage() sys.exit(0) if opt == "-u": - STARTUID=int(val) + try: + STARTUID=int(val) + except: + ErrorMsg("Invalid Starting UID '%s' - Must Be An Integer Value." % val) + sys.exit(1) if opt == "-v": print RCSID sys.exit(0)