GNU bug report logs - #11100
Racy code in copy.c

Previous Next

Package: coreutils;

Reported by: Philipp Thomas <pth <at> suse.de>

Date: Tue, 27 Mar 2012 13:32:02 UTC

Severity: normal

Merged with 11074

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


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

From: Eric Blake <eblake <at> redhat.com>
To: Jim Meyering <jim <at> meyering.net>
Cc: Philipp Thomas <pth <at> suse.de>, 11100 <at> debbugs.gnu.org
Subject: Re: bug#11100: Racy code in copy.c
Date: Fri, 04 May 2012 08:54:05 -0600
[Message part 1 (text/plain, inline)]
On 05/04/2012 08:47 AM, Jim Meyering wrote:
> 
> * src/copy.c (copy_reg): In a narrow race (stat sees dest, yet
> open-without-O_CREAT fails with ENOENT), retry the open with O_CREAT.
> Reported by Philipp Thomas and Neil F. Brown in
> http://debbugs.gnu.org/11100

Question - when we retry with adding O_CREAT, should we also add O_EXCL?
 That is, we already lost the race once, but the O_EXCL will ensure that
we don't lose the race a second time and that we really are creating a file.

-- 
Eric Blake   eblake <at> redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 3 years and 184 days ago.

Previous Next


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