]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve port to platforms lacking euidaccess (Bug#35406)
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 25 Apr 2019 00:41:05 +0000 (17:41 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 25 Apr 2019 00:42:09 +0000 (17:42 -0700)
* lib-src/emacsclient.c (set_local_socket):
Use faccessat with AT_EACCESS instead of using euidaccess.
* admin/merge-gnulib, lib/gnulib.mk.in, m4/gnulib-comp.m4:
Revert previous change.

admin/merge-gnulib
lib-src/emacsclient.c
lib/gnulib.mk.in
m4/gnulib-comp.m4

index cd37582cc0880bbb184bcde84a672a4ae4e5753d..4a69310d83cfcbb0d43ce4808b76326febe24b4c 100755 (executable)
@@ -31,7 +31,7 @@ GNULIB_MODULES='
   count-leading-zeros count-one-bits count-trailing-zeros
   crypto/md5-buffer crypto/sha1-buffer crypto/sha256-buffer crypto/sha512-buffer
   d-type diffseq dosname dtoastr dtotimespec dup2
-  environ euidaccess execinfo explicit_bzero faccessat
+  environ execinfo explicit_bzero faccessat
   fcntl fcntl-h fdopendir
   filemode filevercmp flexmember fpieee fstatat fsusage fsync
   getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog
index 5871a18ce69dc7d57a02cce5e43cb2699302f449..fd56007b156241521a20c44907a0081c53df16d7 100644 (file)
@@ -1472,7 +1472,7 @@ set_local_socket (char const *server_name)
          int sockdirnamelen = snprintf (sockdirname, sizeof sockdirname,
                                         "/run/user/%"PRIuMAX, id);
          if (0 <= sockdirnamelen && sockdirnamelen < sizeof sockdirname
-             && euidaccess (sockdirname, X_OK) == 0)
+             && faccessat (AT_FDCWD, sockdirname, X_OK, AT_EACCESS) == 0)
            message
              (true,
               ("%s: Should XDG_RUNTIME_DIR='%s' be in the environment?\n"
index 165405f2499e4ea35933324a808b102820ce8c50..ade4ff8ebdb9e0cebae8e7b0605e5cf2026d57ca 100644 (file)
@@ -88,7 +88,6 @@
 #  dtotimespec \
 #  dup2 \
 #  environ \
-#  euidaccess \
 #  execinfo \
 #  explicit_bzero \
 #  faccessat \
@@ -1492,7 +1491,9 @@ endif
 ## begin gnulib module euidaccess
 ifeq (,$(OMIT_GNULIB_MODULE_euidaccess))
 
+ifneq (,$(gl_GNULIB_ENABLED_euidaccess))
 
+endif
 EXTRA_DIST += euidaccess.c
 
 EXTRA_libgnu_a_SOURCES += euidaccess.c
@@ -2148,7 +2149,9 @@ endif
 ## begin gnulib module root-uid
 ifeq (,$(OMIT_GNULIB_MODULE_root-uid))
 
+ifneq (,$(gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c))
 
+endif
 EXTRA_DIST += root-uid.h
 
 endif
index d6466a032fce08006e65d2474490847b10f0c890..f648b7a495a5ce7c531039a3d1dc37691c84679c 100644 (file)
@@ -220,12 +220,6 @@ AC_DEFUN([gl_INIT],
   gl_ENVIRON
   gl_UNISTD_MODULE_INDICATOR([environ])
   gl_HEADER_ERRNO_H
-  gl_FUNC_EUIDACCESS
-  if test $HAVE_EUIDACCESS = 0; then
-    AC_LIBOBJ([euidaccess])
-    gl_PREREQ_EUIDACCESS
-  fi
-  gl_UNISTD_MODULE_INDICATOR([euidaccess])
   gl_EXECINFO_H
   gl_FUNC_EXPLICIT_BZERO
   if test $HAVE_EXPLICIT_BZERO = 0; then
@@ -441,6 +435,7 @@ AC_DEFUN([gl_INIT],
   gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=false
   gl_gnulib_enabled_cloexec=false
   gl_gnulib_enabled_dirfd=false
+  gl_gnulib_enabled_euidaccess=false
   gl_gnulib_enabled_getdtablesize=false
   gl_gnulib_enabled_getgroups=false
   gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
@@ -450,6 +445,7 @@ AC_DEFUN([gl_INIT],
   gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false
   gl_gnulib_enabled_open=false
   gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=false
+  gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false
   gl_gnulib_enabled_strtoll=false
   gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=false
   func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b ()
@@ -480,6 +476,22 @@ AC_DEFUN([gl_INIT],
       gl_gnulib_enabled_dirfd=true
     fi
   }
+  func_gl_gnulib_m4code_euidaccess ()
+  {
+    if ! $gl_gnulib_enabled_euidaccess; then
+      gl_FUNC_EUIDACCESS
+      if test $HAVE_EUIDACCESS = 0; then
+        AC_LIBOBJ([euidaccess])
+        gl_PREREQ_EUIDACCESS
+      fi
+      gl_UNISTD_MODULE_INDICATOR([euidaccess])
+      gl_gnulib_enabled_euidaccess=true
+      if test $HAVE_EUIDACCESS = 0; then
+        func_gl_gnulib_m4code_a9786850e999ae65a836a6041e8e5ed1
+      fi
+      func_gl_gnulib_m4code_6099e9737f757db36c47fa9d9f02e88c
+    fi
+  }
   func_gl_gnulib_m4code_getdtablesize ()
   {
     if ! $gl_gnulib_enabled_getdtablesize; then
@@ -576,6 +588,12 @@ AC_DEFUN([gl_INIT],
       gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=true
     fi
   }
+  func_gl_gnulib_m4code_6099e9737f757db36c47fa9d9f02e88c ()
+  {
+    if ! $gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c; then
+      gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=true
+    fi
+  }
   func_gl_gnulib_m4code_strtoll ()
   {
     if ! $gl_gnulib_enabled_strtoll; then
@@ -594,12 +612,12 @@ AC_DEFUN([gl_INIT],
       gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=true
     fi
   }
-  if test $HAVE_EUIDACCESS = 0; then
-    func_gl_gnulib_m4code_a9786850e999ae65a836a6041e8e5ed1
-  fi
   if test $HAVE_FACCESSAT = 0 || test $REPLACE_FACCESSAT = 1; then
     func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
   fi
+  if test $HAVE_FACCESSAT = 0 || test $REPLACE_FACCESSAT = 1; then
+    func_gl_gnulib_m4code_euidaccess
+  fi
   if test $HAVE_FACCESSAT = 0 || test $REPLACE_FACCESSAT = 1; then
     func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7
   fi
@@ -646,6 +664,7 @@ AC_DEFUN([gl_INIT],
   AM_CONDITIONAL([gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b], [$gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_cloexec], [$gl_gnulib_enabled_cloexec])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_dirfd], [$gl_gnulib_enabled_dirfd])
+  AM_CONDITIONAL([gl_GNULIB_ENABLED_euidaccess], [$gl_gnulib_enabled_euidaccess])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_getdtablesize], [$gl_gnulib_enabled_getdtablesize])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_getgroups], [$gl_gnulib_enabled_getgroups])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36])
@@ -655,6 +674,7 @@ AC_DEFUN([gl_INIT],
   AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], [$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_open], [$gl_gnulib_enabled_open])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7], [$gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7])
+  AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], [$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec], [$gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec])
   # End of code from modules