GNU bug report logs - #44131
28.0.50; emacsclient Invalid socket owner error

Previous Next

Package: emacs;

Reported by: Andrew Eggenberger <andrew.eggenberger <at> gmail.com>

Date: Thu, 22 Oct 2020 02:33:01 UTC

Severity: normal

Tags: moreinfo

Found in version 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andrew Eggenberger <andrew.eggenberger <at> gmail.com>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 44131 <at> debbugs.gnu.org
Subject: bug#44131: 28.0.50; emacsclient Invalid socket owner error
Date: Sun, 1 Nov 2020 19:24:42 -0600
[Message part 1 (text/plain, inline)]
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);
     }
[Message part 2 (text/html, inline)]

This bug report was last modified 4 years and 252 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.