]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Fix build on ancient glibc without openat(AT_FDCWD
authorNatanael Copa <ncopa@alpinelinux.org>
Wed, 15 Jan 2025 14:59:17 +0000 (15:59 +0100)
committerAndrew Tridgell <andrew@tridgell.net>
Wed, 15 Jan 2025 19:43:57 +0000 (06:43 +1100)
Fixes: https://github.com/RsyncProject/rsync/issues/701
syscall.c

index 8cea2900d2838aa3da964b1f7243ba5d49ffe7ba..34a9bba08f19945937f6addde7633d96e9e642b0 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -734,7 +734,7 @@ int secure_relative_open(const char *basedir, const char *relpath, int flags, mo
                return -1;
        }
 
-#if !defined(O_NOFOLLOW) || !defined(O_DIRECTORY)
+#if !defined(O_NOFOLLOW) || !defined(O_DIRECTORY) || !defined(AT_FDCWD)
        // really old system, all we can do is live with the risks
        if (!basedir) {
                return open(relpath, flags, mode);