bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#11100: Racy code in copy.c


From: Eric Blake
Subject: bug#11100: Racy code in copy.c
Date: Fri, 04 May 2012 08:54:05 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120424 Thunderbird/12.0

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   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]