From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 15015@debbugs.gnu.org
Subject: bug#15015: Fix some minor races in hosts lacking mkostemp
Date: Sat, 03 Aug 2013 17:55:19 +0300 [thread overview]
Message-ID: <83d2puygbs.fsf@gnu.org> (raw)
In-Reply-To: <51FD1663.6040501@cs.ucla.edu>
> Date: Sat, 03 Aug 2013 07:40:35 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: 15015@debbugs.gnu.org
>
> On 08/03/2013 01:38 AM, Eli Zaretskii wrote:
>
> > the gnulib mkostemp module ... relies on quite a few functions that are
> > redefined in Emacs, and I have no idea what will this do to the gnulib
> > implementation.
>
> I don't see the problem; could you please explain further?
> On Microsoft platforms, the only functions that the mkostemp
> module should use should be getenv, strlen, memcmp,
> gettimeofday, open (..., O_RDWR | O_CREAT | O_EXCL, S_IRUSR
> | S_IWUSR), and lstat, and this sort of thing is already
> working elsewhere.
gettimeofday, open, and lstat are implemented by Emacs in w32.c. At
lest the last 2 are not equivalent to what gnulib uses.
> > 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.
>
> 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. But if
there are two alternatives to fix a problem, and one of them breaks
this "support" while the other doesn't, I'd prefer the latter.
> > I thought of a far easier solution: use the same code as sys_mktemp
> > does, but use 'open' or '_sopen' instead of faccessat.
>
> This won't suffice for POSIXish platforms that lack mkostemp
> but have 'open' with O_EXCL. Solaris is one example. The
> Gnulib mkostemp module fixes the races on those platforms.
That's OK. We can always install the gnulib stuff for those other
platforms, and work around it on Windows.
next prev parent reply other threads:[~2013-08-03 14:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-03 7:40 bug#15015: Fix some minor races in hosts lacking mkostemp Paul Eggert
2013-08-03 8:38 ` Eli Zaretskii
2013-08-03 9:02 ` Eli Zaretskii
2013-08-03 14:40 ` Paul Eggert
2013-08-03 14:55 ` Eli Zaretskii [this message]
2013-08-03 21:26 ` Paul Eggert
2013-08-04 15:44 ` Eli Zaretskii
2013-08-04 17:01 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83d2puygbs.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=15015@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).