MCPcopy Create free account
hub / github.com/RsyncProject/rsync / openat2_beneath

Function openat2_beneath

syscall.c:1701–1708  ·  view source on GitHub ↗

openat2(RESOLVE_BENEATH) via the raw syscall, gated on openat2_usable() so a * seccomp filter that traps openat2 with SIGSYS (e.g. the Android sandbox) * makes us report ENOSYS and fall back rather than killing the process. Only * the openat2 call is gated here; a plain openat() is always safe to attempt. */

Source from the content-addressed store, hash-verified

1699 * makes us report ENOSYS and fall back rather than killing the process. Only
1700 * the openat2 call is gated here; a plain openat() is always safe to attempt. */
1701static int openat2_beneath(int dirfd, const char *path, const struct open_how *how)
1702{
1703 if (!openat2_usable()) {
1704 errno = ENOSYS;
1705 return -1;
1706 }
1707 return syscall(SYS_openat2, dirfd, path, how, sizeof *how);
1708}
1709
1710static int secure_relative_open_linux(const char *basedir, const char *relpath, int flags, mode_t mode)
1711{

Callers 1

Calls 1

openat2_usableFunction · 0.85

Tested by

no test coverage detected