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)

Submitted by:  Ben Webb <benmwebb>
Submitted on:  Fri 02 Jan 2009 02:17:45 AM UTC  
 
Category: Mail ParsingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Crash Error
Status: FixedPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Operating System: LinuxPerl Version: 5.10.0
Component Version: 2.6.16Fixed 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>
Project 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>

 

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
  • -unavailable- added by ehood (Posted a comment)
  • -unavailable- added by benmwebb (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 09 Jan 2011 09:22:15 AM UTCehoodOpen/ClosedOpen=>Closed
    Sun 09 Jan 2011 08:34:38 AM UTCehoodStatusReady For Test=>Fixed
      Fixed Release=>2.6.17
    Fri 31 Dec 2010 09:22:03 PM UTCehoodStatusNone=>Ready For Test
    Fri 02 Jan 2009 02:17:46 AM UTCbenmwebbAttached File-=>Added dir_create.patch, #17185

    Back to the top


    Powered by Savane 3.1-cleanup1