diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2014-07-31 15:41:11 +0200 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2014-07-31 15:41:11 +0200 |
commit | 8080915fba6e3ea6ed06a67420ed4fc27e2e5279 (patch) | |
tree | ef2be58eb602a4007ad4fa7bf9a7caccd29b401e | |
parent | 9c14fbe90499b72202db944bc8c8a6f6a747f458 (diff) | |
download | miniircd-8080915fba6e3ea6ed06a67420ed4fc27e2e5279.tar.gz miniircd-8080915fba6e3ea6ed06a67420ed4fc27e2e5279.zip |
Minor cleanup
-rwxr-xr-x | miniircd | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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") |