]> code.delx.au - offlineimap/commit
Fix Maildir race
authorJohn Goerzen <jgoerzen@complete.org>
Fri, 19 Oct 2007 00:06:18 +0000 (01:06 +0100)
committerJohn Goerzen <jgoerzen@complete.org>
Fri, 19 Oct 2007 00:06:18 +0000 (01:06 +0100)
commit6caaea36e03b9fd74b68ca43e7f4dec91f1ff7f9
tree2e755560e2ea5d487e58793ef983ed98afedc339
parentc476e8c98ca5a17af284fbaf3b3958195db63deb
Fix Maildir race

fixes deb#439384

From: martin f krafft
Subject: race condition in Maildir writing

The offlineimap Maildir code checks for file existence and then
opens a file. That's open to a race condition. It's better to open
the file and fail if it already exists. The following patch does
this. It catches OSError 17 (file exists) and re-raises all others.
I'll leave it up to you to decide whether this is appropriate.
offlineimap/folder/Maildir.py