From: Andrew Eggenberger <andrew.eggenberger@gmail.com>
To: Andrea Corallo <akrl@sdf.org>
Cc: 44131@debbugs.gnu.org
Subject: bug#44131: 28.0.50; emacsclient Invalid socket owner error
Date: Sun, 1 Nov 2020 19:24:42 -0600 [thread overview]
Message-ID: <CANn+amY_qkLyRGqL+oU9ha1_XjH18z9J+E5UuQ7JTmuvza8Vsg@mail.gmail.com> (raw)
In-Reply-To: <xjfy2jxigkc.fsf_-_@sdf.org>
[-- Attachment #1: Type: text/plain, Size: 1001 bytes --]
Hi,
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);
}
[-- Attachment #2: Type: text/html, Size: 1424 bytes --]
next prev parent reply other threads:[~2020-11-02 1:24 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 [this message]
2020-11-07 8:47 ` Eli Zaretskii
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CANn+amY_qkLyRGqL+oU9ha1_XjH18z9J+E5UuQ7JTmuvza8Vsg@mail.gmail.com \
--to=andrew.eggenberger@gmail.com \
--cc=44131@debbugs.gnu.org \
--cc=akrl@sdf.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).