1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-04-28 06:33:36 +00:00

2 Commits

Author SHA1 Message Date
Bruno Haible
5746cd1cdb openat2 tests: Avoid gratuitous test failure when debugging.
* tests/test-openat2.c: Include ignore-value.h.
(do_prepare): Remove left-overs on disk.
* modules/openat2-tests (Depends-on): Add ignore-value.
2025-11-01 13:01:35 +01:00
Paul Eggert
0b97ffdf32 openat2: new module
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.
2025-10-27 17:11:50 -07:00