From f5366343b98fd2ab388d13a40955f55b8559ba9b Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Mon, 19 Sep 2011 09:25:48 +0200 Subject: [PATCH] Fix default Maildir File permissions. open() and os.open() lead to different file permissions by default, and while we have not changed the os.open that had been used, some code changes led to these permissions slipping through. Fix this by setting the permissions explicitly to 0666 (minus the users umask). Signed-off-by: Sebastian Spaeth --- Changelog.draft.rst | 3 +++ offlineimap/folder/Maildir.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Changelog.draft.rst b/Changelog.draft.rst index e4b8055..909ebd6 100644 --- a/Changelog.draft.rst +++ b/Changelog.draft.rst @@ -21,6 +21,9 @@ Changes Bug Fixes --------- +* New emails are not created with "-rwxr-xr-x" but as "-rw-r--r--" + anymore, fixing a regression in 6.3.4. + Pending for the next major release ================================== diff --git a/offlineimap/folder/Maildir.py b/offlineimap/folder/Maildir.py index 894328c..2bfd394 100644 --- a/offlineimap/folder/Maildir.py +++ b/offlineimap/folder/Maildir.py @@ -238,7 +238,7 @@ class MaildirFolder(BaseFolder): # open file and write it out try: fd = os.open(os.path.join(tmpdir, messagename), - os.O_EXCL|os.O_CREAT|os.O_WRONLY) + os.O_EXCL|os.O_CREAT|os.O_WRONLY, 0666) except OSError, e: if e.errno == 17: #FILE EXISTS ALREADY