From: Eli Zaretskii <eliz@gnu.org>
To: Andrew Eggenberger <andrew.eggenberger@gmail.com>,
Paul Eggert <eggert@cs.ucla.edu>
Cc: 44131@debbugs.gnu.org, akrl@sdf.org
Subject: bug#44131: 28.0.50; emacsclient Invalid socket owner error
Date: Sat, 07 Nov 2020 10:47:35 +0200 [thread overview]
Message-ID: <83pn4p7dug.fsf@gnu.org> (raw)
In-Reply-To: <CANn+amY_qkLyRGqL+oU9ha1_XjH18z9J+E5UuQ7JTmuvza8Vsg@mail.gmail.com> (message from Andrew Eggenberger on Sun, 1 Nov 2020 19:24:42 -0600)
> From: Andrew Eggenberger <andrew.eggenberger@gmail.com>
> Date: Sun, 1 Nov 2020 19:24:42 -0600
> Cc: 44131@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.
next prev parent reply other threads:[~2020-11-07 8:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-22 7:32 bug#44131: 28.0.50; emacsclient Invalid socket owner error in gccemacs Andrew Eggenberger
2020-10-22 12:54 ` Lars Ingebrigtsen
2020-10-22 20:41 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-22 23:45 ` Andrew Eggenberger
2020-10-22 23:46 ` Andrew Eggenberger
2020-10-23 6:48 ` bug#44131: 28.0.50; emacsclient Invalid socket owner error Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-02 1:24 ` Andrew Eggenberger
2020-11-07 8:47 ` Eli Zaretskii [this message]
2020-11-11 3:30 ` Andrew Eggenberger
2020-11-11 9:44 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83pn4p7dug.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=44131@debbugs.gnu.org \
--cc=akrl@sdf.org \
--cc=andrew.eggenberger@gmail.com \
--cc=eggert@cs.ucla.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.