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