aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Rodger <paul@paulrodger.com>2002-11-07 22:54:03 +0000
committerPaul Rodger <paul@paulrodger.com>2002-11-07 22:54:03 +0000
commit60f119d64a855895fc1309e3756568727293faef (patch)
treed69128c9af6ec1fc4585bc727bf6fd9089ebfff0
parent9d08aca3b9fffbeb18c8b6acc1bbfedb8d671b74 (diff)
downloadarchivemail-60f119d64a855895fc1309e3756568727293faef.tar.gz
archivemail-60f119d64a855895fc1309e3756568727293faef.tar.bz2
archivemail-60f119d64a855895fc1309e3756568727293faef.zip
Don't assume that root's grpid is '0' -- on solaris it can be different.
-rw-r--r--TODO51
-rwxr-xr-xarchivemail.py5
2 files changed, 32 insertions, 24 deletions
diff --git a/TODO b/TODO
index ab7286e..7f9ab70 100644
--- a/TODO
+++ b/TODO
@@ -1,24 +1,29 @@
+.archivemailrc support
-Goals for next minor release
--------------------------------------
-* .archivemailrc support
-* When you get a file-not-found in the 6th mailbox of 10, it aborts the whole
- run. Better to fail gracefully and keep going.
-* Think about the best way to specify the names of archives created with
- possibly an --archive-name option.
-* Add more tests (see top of test_archivemail.py)
-* We need some better checking to see if we are really looking at a valid
- mbox-format mailbox.
-* Lock any original .gz files
- - is this necessary?
-* Check for symlink attacks for tempfiles (although we don't use /var/tmp)
-
-Longer Term goals:
-------------------
-* Add an option to not cut threads.
-* Add MMDF mailbox support
-* Add Babyl mailbox support
-* Add option to archive depending on mailbox size threshold
- - is this a good idea?
-* Add option to archive depending on number of messages
- - is this a good idea?
+When you get a file-not-found in the 6th mailbox of 10, it aborts the whole
+run. Better to fail gracefully and keep going.
+
+Think about the best way to specify the names of archives created with
+possibly an --archive-name option.
+
+Add more tests (see top of test_archivemail.py)
+
+We need some better checking to see if we are really looking at a valid
+mbox-format mailbox.
+
+Lock any original .gz files
+- is this necessary?
+
+Check for symlink attacks for tempfiles (although we don't use /var/tmp)
+
+Add an option to not cut threads.
+
+Add MMDF mailbox support
+
+Add Babyl mailbox support
+
+Add option to archive depending on mailbox size threshold
+- is this a good idea?
+
+Add option to archive depending on number of messages
+- is this a good idea?
diff --git a/archivemail.py b/archivemail.py
index 3ec7d04..e8f3aab 100755
--- a/archivemail.py
+++ b/archivemail.py
@@ -1007,7 +1007,10 @@ def archive(mailbox_name):
# check to see if we are running as root -- if so, change our effective
# userid and groupid to that of the original mailbox
+
+ former_gid = None # groupid doesn't have to be '0' for root on solaris 8?
if (os.getuid() == 0) and os.path.exists(mailbox_name):
+ former_gid = os.getgid(); # remember this so we can change back
mailbox_user = os.stat(mailbox_name)[stat.ST_UID]
mailbox_group = os.stat(mailbox_name)[stat.ST_GID]
vprint("changing effective group id to: %d" % mailbox_group)
@@ -1054,7 +1057,7 @@ def archive(mailbox_name):
# if we are running as root, revert the seteuid()/setegid() above
if (os.getuid() == 0):
vprint("changing effective groupid and userid back to root")
- os.setegid(0)
+ os.setegid(former_gid)
os.seteuid(0)