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

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

 



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

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