From defe40ee0cc08b1f5e248491e2856c56681f80df Mon Sep 17 00:00:00 2001 From: balki <3070606-balki@users.noreply.gitlab.com> Date: Tue, 18 Dec 2018 16:21:03 -0500 Subject: [PATCH] swap order of setuid and setgid --- mail4one/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail4one/server.py b/mail4one/server.py index d327324..f5427fe 100644 --- a/mail4one/server.py +++ b/mail4one/server.py @@ -95,8 +95,8 @@ def drop_privileges(future): sys.exit(1) nobody = pwd.getpwnam('nobody') try: - os.setuid(nobody.pw_uid) os.setgid(nobody.pw_gid) + os.setuid(nobody.pw_uid) except PermissionError: logging.error("Cannot setuid nobody; run as root") sys.exit(1)