aboutsummaryrefslogtreecommitdiffstats
path: root/archivemail.py
diff options
context:
space:
mode:
authorNikolaus Schulz <microschulz@web.de>2007-11-02 18:47:23 +0000
committerNikolaus Schulz <microschulz@web.de>2007-11-02 18:47:23 +0000
commit3ee105d76612687b12f2a0e1cce5cfdc90e38a5f (patch)
tree7dad80559c4d3fd0733a9d5fb1f43f117c04f88b /archivemail.py
parenta1641450ede4c7cfb4991d31b6232282c5673f6b (diff)
downloadarchivemail-3ee105d76612687b12f2a0e1cce5cfdc90e38a5f.tar.gz
archivemail-3ee105d76612687b12f2a0e1cce5cfdc90e38a5f.tar.bz2
archivemail-3ee105d76612687b12f2a0e1cce5cfdc90e38a5f.zip
If running as root, only switch the effective uid and gid back if we have
actually switched them before.
Diffstat (limited to 'archivemail.py')
-rwxr-xr-xarchivemail.py2
1 files changed, 1 insertions, 1 deletions
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)