summaryrefslogtreecommitdiff
path: root/miniircd
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2017-11-02 22:46:44 +0100
committerJoel Rosdahl <joel@rosdahl.net>2017-11-02 22:46:44 +0100
commita9c3d17539f98e354bd1d30bb089bb13f4f8cfe7 (patch)
tree3f1eb706a15b82c0f8d4637a94dcf8422a6d40d1 /miniircd
parentb78439babec340f02d457a40760b041b90cc4ce2 (diff)
downloadminiircd-a9c3d17539f98e354bd1d30bb089bb13f4f8cfe7.tar.gz
miniircd-a9c3d17539f98e354bd1d30bb089bb13f4f8cfe7.zip
Clean up if statements
Diffstat (limited to 'miniircd')
-rwxr-xr-xminiircd8
1 files changed, 4 insertions, 4 deletions
diff --git a/miniircd b/miniircd
index 0cbf260..51f9747 100755
--- a/miniircd
+++ b/miniircd
@@ -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"