aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorPaul Eggert2012-10-19 09:52:02 -0700
committerPaul Eggert2012-10-19 09:52:02 -0700
commite752e0b0a2622d8d0ba518bf81f6fa652d926e67 (patch)
tree3b7cfbf8aa3ecaa587cd6fbc2d17b64d055d2b07 /admin
parent6ec83f926d5ff699901fb530162d7f1bdfa85808 (diff)
downloademacs-e752e0b0a2622d8d0ba518bf81f6fa652d926e67.tar.gz
emacs-e752e0b0a2622d8d0ba518bf81f6fa652d926e67.zip
Use faccessat, not access, when checking file permissions.
* .bzrignore: Add lib/fcntl.h. * configure.ac (euidaccess): Remove check; gnulib does this for us now. (gl_FCNTL_O_FLAGS): Define a dummy version. * lib/at-func.c, lib/euidaccess.c, lib/faccessat.c, lib/fcntl.in.h: * lib/getgroups.c, lib/group-member.c, lib/root-uid.h: * lib/xalloc-oversized.h, m4/euidaccess.m4, m4/faccessat.m4: * m4/fcntl_h.m4, m4/getgroups.m4, m4/group-member.m4: New files, from gnulib. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * admin/merge-gnulib (GNULIB_MODULES): Add faccessat. (GNULIB_TOOL_FLAGS): Avoid at-internal, fchdir, malloc-posix, openat-die, openat-h, save-cwd. Do not avoid fcntl-h. Omit gnulib's m4/fcntl-o.m4. * nt/inc/ms-w32.h (AT_FDCWD, AT_EACCESS): New symbols. (access): Remove. (faccessat): New macro. * src/Makefile.in (LIB_EACCESS): New macro. (LIBES): Use it. * src/callproc.c (init_callproc): * src/charset.c (init_charset): * src/fileio.c (check_existing, check_executable): * src/lread.c (openp, load_path_check): * src/process.c (allocate_pty): * src/xrdb.c (file_p): Use faccessat, not access or euidaccess. Use symbolic names instead of integers for the flags, as they're portable now. * src/charset.c, src/xrdb.c: Include <fcntl.h>, for the new flags used. * src/fileio.c (Ffile_readable_p): Use faccessat, not stat + open + close. (file_directory_p): New function, which uses 'stat' on most places but 'access' (for efficiency) if WINDOWSNT. * src/fileio.c (Ffile_directory_p, Fset_file_times): * src/xrdb.c (file_p): Use file_directory_p. * src/lisp.h (file_directory_p): New decl. * src/lread.c (openp): When opening a file, use fstat rather than stat, as that avoids a permissions race. When not opening a file, use file_directory_p rather than stat. * src/process.c, src/sysdep.c, src/term.c: All uses of '#ifdef O_NONBLOCK' changed to '#if O_NONBLOCK', to accommodate gnulib O_* tyle. * src/w32.c (sys_faccessat): Rename from sys_access and switch to faccessat's API. All uses changed. Fixes: debbugs:12632
Diffstat (limited to 'admin')
-rw-r--r--admin/ChangeLog8
-rwxr-xr-xadmin/merge-gnulib13
2 files changed, 16 insertions, 5 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog
index e21293d618d..6d08bf7c37e 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,11 @@
12012-10-19 Paul Eggert <eggert@cs.ucla.edu>
2
3 Use faccessat, not access, when checking file permissions (Bug#12632).
4 * merge-gnulib (GNULIB_MODULES): Add faccessat.
5 (GNULIB_TOOL_FLAGS): Avoid at-internal, fchdir, malloc-posix,
6 openat-die, openat-h, save-cwd. Do not avoid fcntl-h.
7 Omit gnulib's m4/fcntl-o.m4.
8
12012-10-12 Kenichi Handa <handa@gnu.org> 92012-10-12 Kenichi Handa <handa@gnu.org>
2 10
3 * charsets/Makefile (JISC6226.map): Add missing mappings. 11 * charsets/Makefile (JISC6226.map): Add missing mappings.
diff --git a/admin/merge-gnulib b/admin/merge-gnulib
index 7fc0b5f4844..3c4d8e8058d 100755
--- a/admin/merge-gnulib
+++ b/admin/merge-gnulib
@@ -28,7 +28,7 @@ GNULIB_URL=git://git.savannah.gnu.org/gnulib.git
28GNULIB_MODULES=' 28GNULIB_MODULES='
29 alloca-opt c-ctype c-strcase 29 alloca-opt c-ctype c-strcase
30 careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 30 careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512
31 dtoastr dtotimespec dup2 environ execinfo 31 dtoastr dtotimespec dup2 environ execinfo faccessat
32 filemode getloadavg getopt-gnu gettime gettimeofday 32 filemode getloadavg getopt-gnu gettime gettimeofday
33 ignore-value intprops largefile lstat 33 ignore-value intprops largefile lstat
34 manywarnings mktime pselect pthread_sigmask readlink 34 manywarnings mktime pselect pthread_sigmask readlink
@@ -39,9 +39,12 @@ GNULIB_MODULES='
39' 39'
40 40
41GNULIB_TOOL_FLAGS=' 41GNULIB_TOOL_FLAGS='
42 --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat 42 --avoid=at-internal
43 --avoid=msvc-inval --avoid=msvc-nothrow 43 --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat
44 --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types 44 --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow
45 --avoid=openat-die --avoid=openat-h
46 --avoid=raise
47 --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types
45 --avoid=threadlib 48 --avoid=threadlib
46 --conditional-dependencies --import --no-changelog --no-vc-files 49 --conditional-dependencies --import --no-changelog --no-vc-files
47 --makefile-name=gnulib.mk 50 --makefile-name=gnulib.mk
@@ -85,7 +88,7 @@ test -x "$gnulib_srcdir"/gnulib-tool || {
85} 88}
86 89
87"$gnulib_srcdir"/gnulib-tool --dir="$src" $GNULIB_TOOL_FLAGS $GNULIB_MODULES && 90"$gnulib_srcdir"/gnulib-tool --dir="$src" $GNULIB_TOOL_FLAGS $GNULIB_MODULES &&
88rm -- "$src"m4/gnulib-cache.m4 "$src"m4/warn-on-use.m4 && 91rm -- "$src"m4/fcntl-o.m4 "$src"m4/gnulib-cache.m4 "$src"m4/warn-on-use.m4 &&
89cp -- "$gnulib_srcdir"/build-aux/texinfo.tex "$src"doc/misc && 92cp -- "$gnulib_srcdir"/build-aux/texinfo.tex "$src"doc/misc &&
90cp -- "$gnulib_srcdir"/build-aux/move-if-change "$src"build-aux && 93cp -- "$gnulib_srcdir"/build-aux/move-if-change "$src"build-aux &&
91autoreconf -i -I m4 -- ${src:+"$src"} 94autoreconf -i -I m4 -- ${src:+"$src"}