GNU bug report logs - #70415
30.0.50; [Cygwin] `lock-file' creates a symlink with funny name

Previous Next

Package: emacs;

Reported by: Katsumi Yamaoka <yamaoka <at> jpl.org>

Date: Tue, 16 Apr 2024 12:34:04 UTC

Severity: normal

Found in version 30.0.50

Done: Ken Brown <kbrown <at> cornell.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: yamaoka <at> jpl.org, 70415 <at> debbugs.gnu.org
Subject: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with funny name
Date: Sun, 05 May 2024 08:40:53 +0300
> Date: Sat, 4 May 2024 18:01:25 -0400
> From: Ken Brown <kbrown <at> cornell.edu>
> Cc: yamaoka <at> jpl.org, 70415 <at> debbugs.gnu.org
> 
> > Not only was the system's page file deemed to be a directory, but it was 
> > deemed to have a negative modification time.  I think that's where the 
> > dash came from.  But I don't know why that prevented the lock file from 
> > being deleted.
> 
> I found the answer: filelock.c:current_lock_owner returns an error if 
> the colon exists and is not followed by a digit.  See filelock.c:421.

Right.  Does the below look like the right change to support such
weird cases?

diff --git a/src/filelock.c b/src/filelock.c
index 01d35c4..86c6eeb 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -419,7 +419,9 @@ current_lock_owner (lock_info_type *owner, Lisp_Object lfname)
       boot += 2;
       FALLTHROUGH;
     case ':':
-      if (! c_isdigit (boot[0]))
+      if (! c_isdigit (boot[0])
+	  /* A negative number.  */
+	  || (boot[0] == '-' && c_isdigit (boot[1])))
 	return EINVAL;
       boot_time = strtoimax (boot, &lfinfo_end, 10);
       break;




This bug report was last modified 1 year and 73 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.