URL:
<http://savannah.nongnu.org/bugs/?25225>
Summary: dir_create() fails to make temporary directories
(PATCH)
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:
_______________________________________________________
Details:
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
"archives/2009/msg00047":
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 mhfile.pl (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
dir_create.patch
<http://savannah.nongnu.org/bugs/download.php?file_id=17185>
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?25225>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV