diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2017-11-02 22:46:44 +0100 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2017-11-02 22:46:44 +0100 |
commit | a9c3d17539f98e354bd1d30bb089bb13f4f8cfe7 (patch) | |
tree | 3f1eb706a15b82c0f8d4637a94dcf8422a6d40d1 /miniircd | |
parent | b78439babec340f02d457a40760b041b90cc4ce2 (diff) | |
download | miniircd-a9c3d17539f98e354bd1d30bb089bb13f4f8cfe7.tar.gz miniircd-a9c3d17539f98e354bd1d30bb089bb13f4f8cfe7.zip |
Clean up if statements
Diffstat (limited to 'miniircd')
-rwxr-xr-x | miniircd | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1026,9 +1026,8 @@ def main(argv): options.ports = "6667" else: options.ports = "6697" - if options.chroot: - if os.getuid() != 0: - op.error("Must be root to use --chroot") + if options.chroot and os.getuid() != 0: + op.error("Must be root to use --chroot") if options.setuid: from pwd import getpwnam from grp import getgrnam @@ -1044,7 +1043,8 @@ def main(argv): else: op.error("Specify a user, or user and group separated by a colon," " e.g. --setuid daemon, --setuid nobody:nobody") - if os.name == "posix" and ((os.getuid() == 0 or os.getgid() == 0) and not options.setuid): + if os.name == "posix" and \ + (os.getuid() == 0 or os.getgid() == 0) and not options.setuid: op.error("Running this service as root is not recommended. Use the" " --setuid option to switch to an unprivileged account after" " startup. If you really intend to run as root, use" |