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

Eric Blake eblake at redhat.com
Wed Jul 31 19:15:51 UTC 2013


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130731/c8bc759c/attachment-0001.sig>


More information about the libvir-list mailing list