From 3ee105d76612687b12f2a0e1cce5cfdc90e38a5f Mon Sep 17 00:00:00 2001 From: Nikolaus Schulz Date: Fri, 2 Nov 2007 18:47:23 +0000 Subject: If running as root, only switch the effective uid and gid back if we have actually switched them before. --- archivemail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'archivemail.py') diff --git a/archivemail.py b/archivemail.py index 8f471b5..170f5a8 100755 --- a/archivemail.py +++ b/archivemail.py @@ -1173,7 +1173,7 @@ def archive(mailbox_name): clean_up() # if we are running as root, revert the seteuid()/setegid() above - if (os.getuid() == 0): + if former_gid != None: vprint("changing effective groupid and userid back to root") os.setegid(former_gid) os.seteuid(0) -- cgit v1.2.3