GNU bug report logs - #79252
Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames

Previous Next

Package: emacs;

Reported by: "R. Diez" <rdiez-2006 <at> rd10.de>

Date: Sat, 16 Aug 2025 07:38:03 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 79252 <at> debbugs.gnu.org, rdiez-2006 <at> rd10.de
Subject: bug#79252: Option 'file-precious-flag' creates unrelatable/untrackable temporary filenames
Date: Sun, 17 Aug 2025 11:07:06 +0300
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: "R. Diez" <rdiez-2006 <at> rd10.de>,  79252 <at> debbugs.gnu.org
> Date: Sun, 17 Aug 2025 09:56:02 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> Hi Eli,
> 
> > Michael, could you please review the patch and tell if you see any
> > issues with it?
> >
> > diff --git a/lisp/files.el b/lisp/files.el
> > index 84e9254..3e85244 100644
> > --- a/lisp/files.el
> > +++ b/lisp/files.el
> > @@ -6245,7 +6245,13 @@ basic-save-buffer-2
> >  		  ;; for saving the buffer.
> >  		  (setq tempname
> >  			(make-temp-file
> > -			 (expand-file-name "tmp" dir)))
> > +                         ;; The MSDOS 8+3 restricted namespace cannot be
> > +                         ;; relied upon to produce a different file name
> > +                         ;; if we append ".tmp".
> > +	                 (if (and (eq system-type 'ms-dos)
> > +		                  (not (msdos-long-file-names)))
> > +                             (expand-file-name "tmp" dir)
> > +                           (concat buffer-file-name ".tmp"))))
> >  		  ;; Pass in nil&nil rather than point-min&max
> >  		  ;; cause we're saving the whole buffer.
> >  		  ;; write-region-annotate-functions may use it.
> 
> On a first glance, it looks OK. I don't know whether we need special care
> for symlinks, i.e., use buffer-file-truename instead of buffer-file-name.

Thanks for the review.

What could be the issues with symlinks?  The directory of
buffer-file-name is writable, so using the name of the symlink should
be okay, since we create a normal file.  Or what am I missing?




This bug report was last modified 20 days ago.

Previous Next


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