bugMHonArc - Bugs: bug #25225, dir_create() fails to make...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitter:  Ben Webb <benmwebb>
Submitted:  Fri 02 Jan 2009 02:17:45 AM UTC
   
 
Category:  Mail Parsing Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Crash Error
Status:  Fixed Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Operating System:  Linux Perl Version:  5.10.0
Component Version:  2.6.16 Fixed Release:  2.6.17

Fri 31 Dec 2010 09:22:03 PM UTC, comment #1: 

Applied change as recommended by this bug item.  Also removed
last return statement so chmod call will happen.  The other
return statement in the tries-loop is left as-is since we
do not change permissions on directories and files that we
do not explicitly create.

Earl Hood <ehood>
Group administrator
Fri 02 Jan 2009 02:17:45 AM UTC, original submission:  

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.)

Ben Webb <benmwebb>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #17185:  dir_create.patch added by benmwebb (405B - application/octet-stream - dir_create.patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ehood (Posted a comment)
  • -email is unavailable- added by benmwebb (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-01-09 ehood Open/ClosedOpen Closed
    2011-01-09 ehood StatusReady For Test Fixed
        Fixed Release 2.6.17
    2010-12-31 ehood StatusNone Ready For Test
    2009-01-02 benmwebb Attached File- Added dir_create.patch, #17185

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code