Sorry for misunderstood the code ,test and submit the patch mistakenly, will submit a new one.<br><br><div class="gmail_quote">2012/6/8 Daniel P. Berrange <span dir="ltr"><<a href="mailto:berrange@redhat.com" target="_blank">berrange@redhat.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, Jun 05, 2012 at 02:21:10PM +0800, Royce Lv wrote:<br>
</div><div><div class="h5">> Libvirt-socket-rw and libvirt-socket-ro are not used only for libvirt or<br>
> root user,<br>
> but also for  unprivileged application such as vdsm,<br>
> Restrain the rundir only read/search for libvirt prevent comunication<br>
> with unprivileged client,change rundir the permission equals to the sockets<br>
> permission.<br>
> See bug:<br>
> <a href="https://bugzilla.redhat.com/show_bug.cgi?id=828073" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=828073</a><br>
><br>
> Signed-off-by: lvroyce <<a href="mailto:lvroyce@linux.vnet.ibm.com">lvroyce@linux.vnet.ibm.com</a>><br>
> ---<br>
>  daemon/libvirtd.c |    2 +-<br>
>  1 files changed, 1 insertions(+), 1 deletions(-)<br>
><br>
> diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c<br>
> index c74cd43..6095072 100644<br>
> --- a/daemon/libvirtd.c<br>
> +++ b/daemon/libvirtd.c<br>
> @@ -293,7 +293,7 @@ daemonUnixSocketPaths(struct daemonConfig *config,<br>
>              if (!(rundir = virGetUserRuntimeDirectory()))<br>
>                  goto error;<br>
><br>
> -            old_umask = umask(077);<br>
> +            old_umask = umask(022);<br>
>              if (virFileMakePath(rundir) < 0) {<br>
>                  umask(old_umask);<br>
>                  goto error;<br>
<br>
</div></div>The bug you quote above talks about being unable to connect<br>
to /var/run/libvirt/libvirt-sock for the privileged libvirtd.<br>
<br>
The change you are proposing here only touches unprivileged<br>
libvirtd when it creates $XDG_RUNTIME_DIR/libvirt.<br>
<br>
Furthermore the change you are proposing is a security flaw,<br>
since the $XDG_RUNTIME_DIR/libvirt directory is *only* intended<br>
to be accessed by the current unprivileged user. Using a umask<br>
of 022 lets it be accessible to any user.<br>
<br>
So NACK to this<br>
<span class="HOEnZb"><font color="#888888"><br>
Daniel<br>
--<br>
|: <a href="http://berrange.com" target="_blank">http://berrange.com</a>      -o-    <a href="http://www.flickr.com/photos/dberrange/" target="_blank">http://www.flickr.com/photos/dberrange/</a> :|<br>
|: <a href="http://libvirt.org" target="_blank">http://libvirt.org</a>              -o-             <a href="http://virt-manager.org" target="_blank">http://virt-manager.org</a> :|<br>
|: <a href="http://autobuild.org" target="_blank">http://autobuild.org</a>       -o-         <a href="http://search.cpan.org/%7Edanberr/" target="_blank">http://search.cpan.org/~danberr/</a> :|<br>
|: <a href="http://entangle-photo.org" target="_blank">http://entangle-photo.org</a>       -o-       <a href="http://live.gnome.org/gtk-vnc" target="_blank">http://live.gnome.org/gtk-vnc</a> :|<br>
</font></span></blockquote></div><br>