GNU bug report logs -
#15015
Fix some minor races in hosts lacking mkostemp
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Sat, 3 Aug 2013 08:29:02 UTC
Severity: normal
Tags: patch
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
> Date: Sat, 03 Aug 2013 00:40:05 -0700
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> CC: Eli Zaretskii <eliz <at> gnu.org>
>
> Here's a proposed patch to fix some minor races in hosts lacking mkostemp.
> I've tested this on Fedora 17 and Solaris 9. Eli recently wrote that he
> didn't think it was feasible to close the races on Microsoft platforms,
> so I'm posting this on bug-gnu-emacs first (with a CC: to Eli to give him
> a heads-up). It looks to me like it may close the races on Microsoft platforms,
> at least if they support O_EXCL, and at any rate I hope it doesn't hurt
> on those platforms.
>
> Most of this patch consists of code copied automatically from Gnulib.
> The meat of the patch is in src/callproc.c and src/filelock.c.
Thanks. However, I'm reluctant to use the gnulib mkostemp module,
because it relies on quite a few functions that are redefined in
Emacs, and I have no idea what will this do to the gnulib
implementation. Also, since we still didn't remove the support for
MS-Windows builds that use nt/configure.bat and the makefile-w32.in
files, the uses of mktemp in the Emacs sources should be left alone
for now, if we go this route.
I thought of a far easier solution: use the same code as sys_mktemp
does, but use 'open' or '_sopen' instead of faccessat. I think this
will solve the problem much more locally and with much smaller impact.
If you agree, I will work on providing 'mkostemp' for w32.
In any case, we cannot just remove the other alternatives; at least
for the MSDOS build we need to keep the HAVE_MKSTEMP version.
This bug report was last modified 11 years and 289 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.