summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xminiircd8
1 files changed, 5 insertions, 3 deletions
diff --git a/miniircd b/miniircd
index ac9357e..bfcc8fa 100755
--- a/miniircd
+++ b/miniircd
@@ -884,10 +884,12 @@ def main(argv):
if os.getuid() != 0:
op.error("Must be root to use --setuid")
matches = options.setuid.split(":")
- if len(matches) > 1:
- options.setuid = (int(getpwnam(matches[0]).pw_uid),int(getgrnam(matches[1]).gr_gid))
+ if len(matches) == 2:
+ options.setuid = (getpwnam(matches[0]).pw_uid,
+ getgrnam(matches[1]).gr_gid)
elif len(matches) == 1:
- options.setuid = (int(getpwnam(matches[0]).pw_uid),int(getpwnam(matches[0]).pw_gid))
+ options.setuid = (getpwnam(matches[0]).pw_uid,
+ getpwnam(matches[0]).pw_gid)
else:
op.error("Specify a user, or user and group separated by a colon,"
" e.g. --setuid daemon, --setuid nobody:nobody")