From 8080915fba6e3ea6ed06a67420ed4fc27e2e5279 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Thu, 31 Jul 2014 15:41:11 +0200 Subject: Minor cleanup --- miniircd | 8 +++++--- 1 file 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") -- cgit v1.2.3