Re: [libvirt] [PATCH] daemon: Fix core dumps if unix_sock_group is set

2011-01-10 Thread Jiri Denemark
> >> If you use fchown(sock->fd) then you avoid any possible race issues. > > > > Except that it doesn't work. That was the first thing I tried but fchown() > > doesn't seem to work on unix sockets. The socket will still ended up with > > root:root ownership regardless on where I put fchown() --

Re: [libvirt] [PATCH] daemon: Fix core dumps if unix_sock_group is set

2011-01-07 Thread Eric Blake
On 01/07/2011 05:30 AM, Jiri Denemark wrote: >>> 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-so

Re: [libvirt] [PATCH] daemon: Fix core dumps if unix_sock_group is set

2011-01-07 Thread Jiri Denemark
> > 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. > >

Re: [libvirt] [PATCH] daemon: Fix core dumps if unix_sock_group is set

2011-01-07 Thread Daniel P. Berrange
On Fri, Jan 07, 2011 at 12:50:25PM +0100, Jiri Denemark wrote: > 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] [PATCH] daemon: Fix core dumps if unix_sock_group is set

2011-01-07 Thread Jiri Denemark
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 proces