Your message dated Thu, 18 Oct 2007 19:32:05 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#439384: fixed in offlineimap 5.99.3
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: offlineimap
Version: 5.99.1
Severity: normal
Tags: patch

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.

--- /var/lib/python-support/python2.5/offlineimap/folder/Maildir.py     
2007-07-04 13:14:39.000000000 +0100
+++ /tmp/Maildir.py     2007-08-24 17:07:59.000000000 +0100
@@ -146,7 +146,8 @@
         # Otherwise, save the message in tmp/ and then call savemessageflags()
         # to give it a permanent home.
         tmpdir = os.path.join(self.getfullname(), 'tmp')
-        messagename = None
+        file = fd = None
+        messagename = tmpmessaename = None
         attempts = 0
         while 1:
             if attempts > 15:
@@ -159,19 +160,24 @@
                            socket.gethostname(),
                            uid,
                            md5.new(self.getvisiblename()).hexdigest())
-            if os.path.exists(os.path.join(tmpdir, messagename)):
-                time.sleep(2)
-                attempts += 1
-            else:
-                break
-        tmpmessagename = messagename.split(',')[0]
-        ui.debug('maildir', 'savemessage: using temporary name %s' % 
tmpmessagename)
-        file = open(os.path.join(tmpdir, tmpmessagename), "wt")
+            tmpmessagename = messagename.split(',')[0]
+            try:
+                fd = os.open(os.path.join(tmpdir, tmpmessagename),
+                        os.O_WRONLY + os.O_CREAT + os.O_EXCL)
+                file = os.fdopen(fd, 'w')
+                ui.debug('maildir', 'savemessage: using temporary name %s' % 
tmpmessagename)
+            except OSError, e:
+                if e.errno == 17:
+                    time.sleep(2)
+                    attempts += 1
+                    continue
+                raise
+
         file.write(content)
 
         # Make sure the data hits the disk
         file.flush()
-        os.fsync(file.fileno())
+        os.fsync(fd)
 
         file.close()
         if rtime != None:

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.21-2-686 (SMP w/1 CPU core)
Locale: LANG=en_GB, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages offlineimap depends on:
ii  python                        2.4.4-6    An interactive high-level object-o
ii  python-support                0.6.4      automated rebuilding support for p

offlineimap recommends no packages.

-- no debconf information

-- 
 .''`.   martin f. krafft <[EMAIL PROTECTED]>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)


--- End Message ---
--- Begin Message ---
Source: offlineimap
Source-Version: 5.99.3

We believe that the bug you reported is fixed in the latest version of
offlineimap, which is due to be installed in the Debian FTP archive:

offlineimap_5.99.3.dsc
  to pool/main/o/offlineimap/offlineimap_5.99.3.dsc
offlineimap_5.99.3.tar.gz
  to pool/main/o/offlineimap/offlineimap_5.99.3.tar.gz
offlineimap_5.99.3_all.deb
  to pool/main/o/offlineimap/offlineimap_5.99.3_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
John Goerzen <[EMAIL PROTECTED]> (supplier of updated offlineimap package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Thu, 18 Oct 2007 14:03:39 -0500
Source: offlineimap
Binary: offlineimap
Architecture: source all
Version: 5.99.3
Distribution: unstable
Urgency: low
Maintainer: John Goerzen <[EMAIL PROTECTED]>
Changed-By: John Goerzen <[EMAIL PROTECTED]>
Description: 
 offlineimap - IMAP/Maildir synchronization and reader support
Closes: 433739 439384
Changes: 
 offlineimap (5.99.3) unstable; urgency=low
 .
   * Fix a potential Maildir race.  Thanks to Martin F. Krafft for the
     patch.  Closes: #439384.
   * SGML syntax fix.
   * Patches from Daniel Jacobowitz:
     + New -q (quick) option to only update folders that seem to have
       significant changes
     + Fix to UID validity problems some had reported with Courier
     + Maildir checking speedups
     + Display fixes for Curses.Blinkenlights
   * Fixed locked( )for noninteractive UIs.  Thanks to Mark A. Hershberger
     for the patch.
   * Configurable thread status character for ui.Curses.Blinkenlights.
     Thanks to [EMAIL PROTECTED] for the patch.
   * Documented remotehosteval.  Thanks to Ben Kibbey.
   * [debian] Added build-dep on man-db.  Closes: #433739.
Files: 
 c6a5bbd21268fa75b72aa9314c46dc70 705 mail optional offlineimap_5.99.3.dsc
 4a0872340fc3dfbef552cc9d61cee193 91842 mail optional offlineimap_5.99.3.tar.gz
 010c29a0199a3fbdedc387d0e97fd5e5 141820 mail optional 
offlineimap_5.99.3_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHF7H2TvSuJuBy3ggRArnrAJ9bJav1avotLd8YzLB6Apvhsg7PSgCeNmgt
vWMxX/VZvw6pO9JLDA+Xe1Y=
=EeCq
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to