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

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



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

Attachment: signature.asc
Description: OpenPGP digital signature


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