GNU bug report logs -
#44131
28.0.50; emacsclient Invalid socket owner error
Previous Next
Full log
View this message in rfc822 format
> From: Andrew Eggenberger <andrew.eggenberger <at> gmail.com>
> Date: Sun, 1 Nov 2020 19:24:42 -0600
> Cc: 44131 <at> debbugs.gnu.org
>
> The problem seems to stem from the way the hurd treats fstat calls on local socket
> file descriptors. They all have the uid of 0 (root), while emacsclient can be run by
> other users. After trying to teach the hurd's local socket server to use the uid of
> the user who requested the socket and failing, I created the naive patch below that
> fixes the problem.
>
> Please let me know if there's a better solution. I git blamed the changes that led to this
> issue and I don't understand the race condition the uid comparison is supposed prevent.
>
> Andrew Eggenberger
>
> diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
> index 871fa7a8d3..6059993ff6 100644
> --- a/lib-src/emacsclient.c
> +++ b/lib-src/emacsclient.c
> @@ -1480,8 +1480,13 @@ set_local_socket (char const *server_name)
> sock_status = errno;
> else if (connect_stat.st_uid == uid)
> return s;
> +#ifdef __GNU__
> + else
> + return s;
> +#else
> else
> sock_status = -1;
> +#endif
>
> CLOSE_SOCKET (s);
> }
Paul, any better ideas? Or should I push this fix?
Thanks.
This bug report was last modified 4 years and 253 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.