GNU bug report logs - #75938
31.0.50; Temporary file-names overflowing MAX_PATH characters

Previous Next

Package: emacs;

Reported by: arthur miller <arthur.miller <at> live.com>

Date: Thu, 30 Jan 2025 03:46:01 UTC

Severity: normal

Found in version 31.0.50

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

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: arthur miller <arthur.miller <at> live.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 31.0.50; Temporary file-names overflowing MAX_PATH characters
Date: Thu, 30 Jan 2025 03:45:43 +0000
[Message part 1 (text/plain, inline)]
I am not sure if this is a bug or not; so do what you want with this.

It is fully possibly to create names that are not valid as file names,
via make-temp-name and make-temp-file, which are frontend for the
make-temp-file-internal function. For example:

(make-temp-name (make-string 1024 ?a))

will succeed without problems, but of course:

(make-temp-file (make-string 1024 ?a))

will fail, later on when it actually tries to create the file.

Attached is a suggested fix; the idea is to save the unnecessary trip to
the OS; it signals error if the total file name length is longer than
MAX_PATH.

I don't know if it is a feature to have temp-names longer than certain
length, if it is than OK; this is more of a question/suggestion than a
bug report.
[Message part 2 (text/html, inline)]
[0001-Ensure-temporary-file-names-have-valid-lengths.patch (application/octet-stream, attachment)]

This bug report was last modified 170 days ago.

Previous Next


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