mirror of
https://https.git.savannah.gnu.org/git/gnulib.git
synced 2026-06-15 15:25:49 +00:00
0b97ffdf32
This supports the openat2 system call of Linux 5.6 (2020) and later. Although not yet exposed by glibc, the call is useful for programs like GNU Tar that need to be paranoid about traversing file names from untrusted sources. On platforms lacking openat2, it is emulated in user space. * lib/openat2.c, m4/openat2.m4, modules/openat2: * modules/openat2-tests, tests/test-openat2.c: New files. * lib/fcntl.in.h (struct open_how, RESOLVE_NO_XDEV) (RESOLVE_NO_MAGICLINKS, RESOLVE_NO_SYMLINKS, RESOLVE_BENEATH) (RESOLVE_IN_ROOT, RESOLVE_CACHED): New type and constants, if <linux/openat2.h> does not define. (openat2): New decls. * m4/fcntl_h.m4 (gl_FCNTL_H, gl_FCNTL_H_REQUIRE_DEFAULTS) (gl_FCNTL_H_DEFAULTS): * modules/fcntl-h (fcntl.h): Also check for openat2.
50 lines
1.0 KiB
Plaintext
50 lines
1.0 KiB
Plaintext
Description:
|
|
openat2() function: Open a file at a directory.
|
|
|
|
Files:
|
|
lib/openat2.c
|
|
m4/openat2.m4
|
|
|
|
Depends-on:
|
|
fcntl-h
|
|
extensions
|
|
close [test $HAVE_OPENAT2 = 0]
|
|
eloop-threshold [test $HAVE_OPENAT2 = 0]
|
|
errno-h [test $HAVE_OPENAT2 = 0]
|
|
filename [test $HAVE_OPENAT2 = 0]
|
|
ialloc [test $HAVE_OPENAT2 = 0]
|
|
idx [test $HAVE_OPENAT2 = 0]
|
|
largefile [test $HAVE_OPENAT2 = 0]
|
|
openat [test $HAVE_OPENAT2 = 0]
|
|
readlinkat [test $HAVE_OPENAT2 = 0]
|
|
stdckdint-h [test $HAVE_OPENAT2 = 0]
|
|
sys_stat-h [test $HAVE_OPENAT2 = 0]
|
|
unistd-h [test $HAVE_OPENAT2 = 0]
|
|
verify [test $HAVE_OPENAT2 = 0]
|
|
|
|
configure.ac:
|
|
gl_FUNC_OPENAT2
|
|
gl_CONDITIONAL([GL_COND_OBJ_OPENAT2],
|
|
[test $HAVE_OPENAT2 = 0])
|
|
AM_COND_IF([GL_COND_OBJ_OPENAT], [
|
|
gl_PREREQ_OPENAT2
|
|
])
|
|
gl_FCNTL_MODULE_INDICATOR([openat2])
|
|
|
|
Makefile.am:
|
|
if GL_COND_OBJ_OPENAT2
|
|
lib_SOURCES += openat2.c
|
|
endif
|
|
|
|
Include:
|
|
<fcntl.h>
|
|
|
|
Link:
|
|
$(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise
|
|
|
|
License:
|
|
GPL
|
|
|
|
Maintainer:
|
|
all
|