bugThe nmh Mail Handling System - Bugs: bug #9863, dotlocking not working properly

 
 

bug #9863: dotlocking not working properly

Submitted by:  None
Submitted on:  Tue 03 Aug 2004 11:02:22 PM UTC  
 
Category: compatibilitySeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: NoneOpen/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 09 Nov 2005 10:35:07 PM UTC, comment #1:

This bug was fixed (in a different way) by this checkin:

sbr/lock_file.c Revision 1.11 Tue Oct 12 20:40:25 2004 UTC (12 months, 4 weeks ago) by jon

Fixed strange bug that prevented a lock from ever being obtained if getting it failed the first time. The problem was that the string of XXXXXX that is required by mkstemp() was overwritten the first time through, and so all subsequent times failed because mkstemp() failed. The fix reinitializes the tmp file string.

So I'm closing this bug.

Peter Maydell <pm215>
Project Administrator
Tue 03 Aug 2004 11:02:22 PM UTC, original submission:

In routine lockit() of lock_file.c, the mkstemp(tmplock) call modifies the template in tmplock after it has failed (this is on Fedora). The modified tmplock, which is kept around in nmh, makes subsequent mkstemp calls fail and the locking never succeeds.

Here is a patch:

--- sbr/lock_file.c 2004/07/30 23:27:11 1.1
+++ sbr/lock_file.c 2004/08/02 17:22:37
@@ -425,14 +510,15 @@
lockit (struct lockinfo *li)
{
int fd;
- char curlock, tmplock;
+ char *curlock, tmplock[sizeof(li->tmplock)];

#if 0
char buffer[128];
#endif

curlock = li->curlock;
- tmplock = li->tmplock;
+ (void) strncpy(tmplock, li->tmplock, sizeof(tmplock) - 1);
+ tmplock[sizeof(tmplock)-1] = '\0';

#ifdef HAVE_MKSTEMP
if ((fd = mkstemp(tmplock)) == -1)

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

CC list is empty

 

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

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 09 Nov 2005 10:35:07 PM UTCpm215Open/ClosedOpen=>Closed
Wed 09 Nov 2005 10:35:06 PM UTCpm215StatusNone=>Fixed
Wed 09 Nov 2005 12:33:22 PM UTCbressDependencies-=>bugs #14940 is dependent

Back to the top


Powered by Savane 3.1-cleanup1