GNU bug report logs - #15015
Fix some minor races in hosts lacking mkostemp

Previous Next

Package: emacs;

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 #20 received at 15015 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 15015 <at> debbugs.gnu.org
Subject: Re: bug#15015: Fix some minor races in hosts lacking mkostemp
Date: Sat, 03 Aug 2013 14:26:20 -0700
On 08/03/2013 07:55 AM, Eli Zaretskii wrote:

> gettimeofday, open, and lstat are implemented by Emacs in w32.c.  At
> lest the last 2 are not equivalent to what gnulib uses.

The lack of equivalence shouldn't matter.  The lstat call
(though it is compiled) won't be used by Emacs's use of the
mkostemp module on Microsoft platforms, so it's OK.  
mkostemp always calls 'open' with O_CREAT | O_EXCL; in that
case sys_open is just a simple wrapper around _open, so that
should be OK too.  And gettimeofday, as you mentioned, isn't
a problem.

>> Presumably nt/configure.bat and makefile-w32.in could be updated
>> to compile the new files.  This sort of thing should be routine,
>> if that avenue is still supported.
>
> This "support" needs volunteers, which didn't yet show up.

If nobody's supporting it, then it's not really supported.
It's not a big deal -- if someone wants to start supporting
that build mechanism again, it'd be an easy-enough task.
In the meantime we needn't let a deprecated and
apparently-unsupported build mechanism get in the way of
fixing bugs in mainstream builds.

> We can always install the gnulib stuff for those other platforms

Yes, that's a given.  We need to do that, to fix the race
condition bugs in OS X, Solaris, etc.

> and work around it on Windows.

I'm trying to help save work in the Windows port, by having
Windows Emacs use Gnulib mkostemp (which will be in the
source code anyway) the same way it's being used on OS X etc.
If this approach is feasible, it should save us all some
work; if not, it should be easy for a Windows expert to work
around any problems in w32.c and/or msdos.c.





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.