diff options
author | Phil Pennock <pdp@exim.org> | 2011-02-21 00:38:07 -0500 |
---|---|---|
committer | Phil Pennock <pdp@exim.org> | 2011-02-21 00:39:09 -0500 |
commit | 660242ad27370c2190afb53bc50efa949b06f5f0 (patch) | |
tree | ed8f8adbd9dfb4a7b6912aa011e70ce618ba4554 | |
parent | 29cfeb94e35eb8fe2b6f02fe9c9444edb251fd71 (diff) |
Deal with maildir quota file races.
Based on patch from Heiko Schlittermann.
Fixes bug 1086.
-rw-r--r-- | doc/doc-txt/ChangeLog | 3 | ||||
-rw-r--r-- | src/src/transports/appendfile.c | 13 | ||||
-rw-r--r-- | src/src/transports/tf_maildir.c | 2 |
3 files changed, 15 insertions, 3 deletions
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 1fb19caee..3764a88a1 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -66,6 +66,9 @@ PP/11 Bugzilla 1055: Update $message_linecount for maildir_tag. PP/12 Bugzilla 1056: Improved spamd server selection. Patch from Mark Zealey. +PP/13 Bugzilla 1086: Deal with maildir quota file races. + Based on patch from Heiko Schlittermann. + Exim version 4.74 ----------------- diff --git a/src/src/transports/appendfile.c b/src/src/transports/appendfile.c index 6dbb35262..e5ab65765 100644 --- a/src/src/transports/appendfile.c +++ b/src/src/transports/appendfile.c @@ -2419,9 +2419,18 @@ else "%s/maildirsize", check_path); return FALSE; } + else if (maildirsize_fd == -2) + { + DEBUG(D_transport) debug_printf("disabling quota check because of " + "races updating %s/maildirsize", check_path); + disable_quota = TRUE; + } - if (mailbox_size < 0) mailbox_size = size; - if (mailbox_filecount < 0) mailbox_filecount = filecount; + if (maildirsize_fd >= 0) + { + if (mailbox_size < 0) mailbox_size = size; + if (mailbox_filecount < 0) mailbox_filecount = filecount; + } } /* No quota enforcement; ensure file does *not* exist; calculate size if diff --git a/src/src/transports/tf_maildir.c b/src/src/transports/tf_maildir.c index 7411d9a3e..472b0764d 100644 --- a/src/src/transports/tf_maildir.c +++ b/src/src/transports/tf_maildir.c @@ -584,7 +584,7 @@ else "a later subdirectory modification\n"); (void)Uunlink(filename); (void)close(fd); - fd = -1; + fd = -2; } } |