aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorGlenn Morris2018-11-13 13:15:39 -0500
committerGlenn Morris2018-11-13 13:15:39 -0500
commit5c0d8bb95bbd5354e6b2cd2e56a91afe4e780759 (patch)
treeb7ab493d579c39442b3aa497ca00ceb38894aa32 /lib-src
parent578c905ac758de41145a2e080da1e1c1c5c6b1ee (diff)
downloademacs-5c0d8bb95bbd5354e6b2cd2e56a91afe4e780759.tar.gz
emacs-5c0d8bb95bbd5354e6b2cd2e56a91afe4e780759.zip
Root emacsclient no longer connects to non-root sockets
* lib-src/emacsclient.c (set_local_socket): Don't ignore socket ownership when run by root. Ref: http://lists.gnu.org/r/emacs-devel/2018-11/msg00019.html
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/emacsclient.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 42b8dd6227b..6fbc2300958 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -1365,14 +1365,9 @@ set_local_socket (const char *local_socket_name)
1365 switch (sock_status) 1365 switch (sock_status)
1366 { 1366 {
1367 case 1: 1367 case 1:
1368 /* There's a socket, but it isn't owned by us. This is OK if 1368 /* There's a socket, but it isn't owned by us. */
1369 we are root. */ 1369 message (true, "%s: Invalid socket owner\n", progname);
1370 if (0 != geteuid ()) 1370 return INVALID_SOCKET;
1371 {
1372 message (true, "%s: Invalid socket owner\n", progname);
1373 return INVALID_SOCKET;
1374 }
1375 break;
1376 1371
1377 case 2: 1372 case 2:
1378 /* `stat' failed */ 1373 /* `stat' failed */