]> git.ipfire.org Git - thirdparty/libvirt.git/commit
daemon: Fix core dumps if unix_sock_group is set
authorJiri Denemark <jdenemar@redhat.com>
Fri, 7 Jan 2011 11:34:12 +0000 (12:34 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 10 Jan 2011 10:01:46 +0000 (11:01 +0100)
commit5e5acbc8d67e1ac074320176bbc3682b9ba934c0
tree2d537f217297c55c24acbd17cf04490d4f0a6595
parentdda24845fe232a81e6f8b2596bf21df7a9d74d5a
daemon: Fix core dumps if unix_sock_group is set

Setting unix_sock_group to something else than default "root" in
/etc/libvirt/libvirtd.conf prevents system libvirtd from dumping core on
crash. This is because we used setgid(unix_sock_group) before binding to
/var/run/libvirt/libvirt-sock* and setgid() back to original group.
However, if a process changes its effective or filesystem group ID, it
will be forbidden from leaving core dumps unless fs.suid_dumpable sysctl
is set to something else then 0 (and it is 0 by default).

Changing socket's group ownership after bind works better. And we can do
so without introducing a race condition since we loosen access rights by
changing the group from root to something else.
daemon/libvirtd.c