Re: [PATCH] build: prefer mkostemp for multi-thread safety

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

 



On 10/31/2012 09:45 AM, Martin Kletzander wrote:
> On 10/31/2012 03:42 PM, Eric Blake wrote:
>> https://bugzilla.redhat.com/show_bug.cgi?id=871756
>>
>> Commit cd1e8d1 assumed that systems new enough to have journald
>> also have mkostemp; but this is not true for uclibc.
>>
>> For that matter, use of mkstemp[s] is unsafe in a multi-threaded
>> program.  We should prefer mkostemp[s] in the first place.

>> -    fd = mkstemps(ret, 4);
>> +    fd = mkostemps(ret, 4, O_CLOEXEC);
>>      if (fd == -1) {
>>          vshError(ctl, _("mkstemps: failed to create temporary file: %s"),
> 
> This message should be changed as well.
> 
>>                   virStrerror(errno, ebuf, sizeof(ebuf)));
>>
> 
> ACK with that changed.

Fixed and pushed.  Hopefully Leonardo can give libvirt.git a test (since
we probably won't have any more rc builds between now and 1.0.0 on Friday).

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]