summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw1998-11-04 23:49:03 +0000
committerbwarsaw1998-11-04 23:49:03 +0000
commit5ce88dfc665ccec9db156c69cbf6ad84d89562b8 (patch)
treebd7ce75f7e0bacb61d8b4afcab72bbd24d0029e7
parentf850176fa13c48416d68f5ffee24b61932581fc3 (diff)
downloadmailman-5ce88dfc665ccec9db156c69cbf6ad84d89562b8.tar.gz
mailman-5ce88dfc665ccec9db156c69cbf6ad84d89562b8.tar.zst
mailman-5ce88dfc665ccec9db156c69cbf6ad84d89562b8.zip
Changes to avoid having to chmod files, which may fail.
Import open_ex() from Mailman.Utils and assign it to open in the module's globals, so this gets picked up before builtin open. Saves rewriting lots of occurances of open(), but could be confusing when reading a method. Hmmm... __openIndices(): If the `database' directory does not exist, create it specifically with mode = 02770. We want o-rx so this directory is not accessible when the archive is public. But we must have g+wxs or the competing processes (mail and web) that try to update these files (when a message is posted, or web approved after being held), can get to and write the files.
-rw-r--r--Mailman/Archiver/HyperDatabase.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Mailman/Archiver/HyperDatabase.py b/Mailman/Archiver/HyperDatabase.py
index 8fc3808bc..488c4677e 100644
--- a/Mailman/Archiver/HyperDatabase.py
+++ b/Mailman/Archiver/HyperDatabase.py
@@ -26,6 +26,9 @@ import string
#
import pipermail
from Mailman import flock
+from Mailman.Utils import mkdir, open_ex
+# TBD: ugly, ugly, ugly -baw
+open = open_ex
CACHESIZE = pipermail.CACHESIZE
@@ -219,8 +222,8 @@ class HyperDatabase(pipermail.Database):
if self.__currentOpenArchive==archive: return
self.__closeIndices()
arcdir=os.path.join(self.basedir, 'database')
- try: os.mkdir(arcdir, 0700)
- except os.error: pass
+ try: mkdir(arcdir, mode=02770)
+ except os.error: pass
for i in ['date', 'author', 'subject', 'article', 'thread']:
t=DumbBTree(os.path.join(arcdir, archive+'-'+i))
setattr(self, i+'Index', t)