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 /src | |
parent | 29cfeb94e35eb8fe2b6f02fe9c9444edb251fd71 (diff) |
Deal with maildir quota file races.
Based on patch from Heiko Schlittermann.
Fixes bug 1086.
Diffstat (limited to 'src')
-rw-r--r-- | src/src/transports/appendfile.c | 13 | ||||
-rw-r--r-- | src/src/transports/tf_maildir.c | 2 |
2 files changed, 12 insertions, 3 deletions
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; } } |