emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-28 732c70a: Simplify socket symlink-attack checking


From: Paul Eggert
Subject: emacs-28 732c70a: Simplify socket symlink-attack checking
Date: Sun, 3 Oct 2021 14:42:37 -0400 (EDT)

branch: emacs-28
commit 732c70a0d9d8db6a2fd77a52185f9a76743b05a9
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    Simplify socket symlink-attack checking
    
    This is a minor bugfix cleanup (Bug#33847#161).
    * lib-src/emacsclient.c: Move "#include <acl.h>" to inside
    "#ifdef SOCKETS_IN_FILE_SYSTEM", which is more accurate
    and simpler than having a separate "#ifndef WINDOWSNT".
    (O_PATH): Likewise.
---
 lib-src/emacsclient.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 018e81e..cff3cec 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -80,9 +80,6 @@ char *w32_getenv (const char *);
 #include <sys/stat.h>
 #include <unistd.h>
 
-#ifndef WINDOWSNT
-# include <acl.h>
-#endif
 #include <filename.h>
 #include <intprops.h>
 #include <min-max.h>
@@ -94,10 +91,6 @@ char *w32_getenv (const char *);
 # pragma GCC diagnostic ignored "-Wformat-truncation=2"
 #endif
 
-#if !defined O_PATH && !defined WINDOWSNT
-# define O_PATH O_SEARCH
-#endif
-
 
 /* Name used to invoke this program.  */
 static char const *progname;
@@ -1135,6 +1128,12 @@ process_grouping (void)
 
 #ifdef SOCKETS_IN_FILE_SYSTEM
 
+# include <acl.h>
+
+# ifndef O_PATH
+#  define O_PATH O_SEARCH
+# endif
+
 /* A local socket address.  The union avoids the need to cast.  */
 union local_sockaddr
 {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]