[bug #25225] dir_create() fails to make temporary directories (PATCH)

2009-01-01 21:18:08


                 Summary: dir_create() fails to make temporary directories
                 Project: MHonArc
            Submitted by: benmwebb
            Submitted on: Fri 02 Jan 2009 02:17:45 AM GMT
                Category: Mail Parsing
                Severity: 3 - Normal
              Item Group: Crash Error
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: Linux
            Perl Version: 5.10.0
       Component Version: 2.6.16
           Fixed Release: 



Using MHonArc to produce a web archive of an mbox with a command similar to

mhonarc foo.mbox -rcfile foo.rc -outdir archives/2009/

(where archives/2009 does not yet exist) fails when it reaches the first
email with an attachment, with an error message similar to

ERROR: Unable to rename "archives/2009/dir<random string>" to

However, checking the archives/2009 directory reveals that the msg00047
directory *does* exist, and in fact if the same mhonarc command is rerun it
passes that message successfully - but then fails on the next message with an
attachment (and so on). Also, the directory is created with the wrong
permissions (it is not world-readable, so Apache can't read the attachments).

I tracked down the problem to the dir_create() function in (see
attached patch). If the rename of $tmpdir to $path *succeeds*, the loop
continues until TEMP_MAX_TRIES is exceeded. The attached patch exits the loop
after the first successful rename().

BTW, since chmod() is run on the new directory at the end of that function,
perhaps the last 'return' statement should be removed? (And maybe the
second-to-last should become a 'last', but that one I'm not so sure about.)


File Attachments:

Date: Fri 02 Jan 2009 02:17:46 AM GMT  Name: dir_create.patch  Size: 405B  
By: benmwebb


Reply to this item at:


  Message sent via/by Savannah

To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the

<Prev in Thread] Current Thread [Next in Thread>
  • [bug #25225] dir_create() fails to make temporary directories (PATCH), Ben Webb <=