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

Re: [libvirt] [PATCH 2/2] virt-login-shell joins users into lxc container.



On 07/31/2013 12:57 PM, Daniel P. Berrange wrote:

>> +    if (virFork(&cpid) < 0)
>> +	goto cleanup;
>> +
...
>> +	}
>> +
>> +	if ((ngroups = virGetGroupList(uid, gid, &groups)) < 0)
>> +	    return EXIT_FAILURE;
> 
> virGetGroupList isn't safe to call after fork(). Need to
> move it earlier in this function.

Technically, it is only unsafe to call after fork() if the parent
process was multi-threaded.  But as virt-login-shell is single-threaded,
we can get away with it here.

-- 
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]