Re: [Spice-devel] [PATCH spice-server] RFC: Support abstract Unix sockets

2017-11-22 Thread Daniel P. Berrange
On Wed, Nov 22, 2017 at 11:54:10AM +, Frediano Ziglio wrote:
> Allows to specify abstract Unix sockets addresses.
> These Unix sockets are supported on Linux and allows to not
> have file system names.
> 
> Signed-off-by: Frediano Ziglio 
> ---
>  server/reds.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/server/reds.c b/server/reds.c
> index ebcbe496..2b43bc0d 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -2587,6 +2587,9 @@ static int reds_init_socket(const char *addr, int 
> portnr, int family)
>  g_strlcpy(local.sun_path, addr, sizeof(local.sun_path));
>  unlink(local.sun_path);

You shouldn't be unlinking this path when its an abstract socket.
Likewise if there's any cleanup code elsewhere that unlinks...

>  len = SUN_LEN();
> +if (local.sun_path[0] == '@') {
> +local.sun_path[0] = 0;
> +}


Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH spice-server] RFC: Support abstract Unix sockets

2017-11-22 Thread Frediano Ziglio
Allows to specify abstract Unix sockets addresses.
These Unix sockets are supported on Linux and allows to not
have file system names.

Signed-off-by: Frediano Ziglio 
---
 server/reds.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/server/reds.c b/server/reds.c
index ebcbe496..2b43bc0d 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2587,6 +2587,9 @@ static int reds_init_socket(const char *addr, int portnr, 
int family)
 g_strlcpy(local.sun_path, addr, sizeof(local.sun_path));
 unlink(local.sun_path);
 len = SUN_LEN();
+if (local.sun_path[0] == '@') {
+local.sun_path[0] = 0;
+}
 if (bind(slisten, (struct sockaddr *), len) == -1) {
 perror("bind");
 return -1;
-- 
2.14.3

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel