summaryrefslogtreecommitdiff
path: root/miniircd
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2014-07-31 15:41:11 +0200
committerJoel Rosdahl <joel@rosdahl.net>2014-07-31 15:41:11 +0200
commit8080915fba6e3ea6ed06a67420ed4fc27e2e5279 (patch)
treeef2be58eb602a4007ad4fa7bf9a7caccd29b401e /miniircd
parent9c14fbe90499b72202db944bc8c8a6f6a747f458 (diff)
downloadminiircd-8080915fba6e3ea6ed06a67420ed4fc27e2e5279.tar.gz
miniircd-8080915fba6e3ea6ed06a67420ed4fc27e2e5279.zip
Minor cleanup
Diffstat (limited to 'miniircd')
-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")