]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Only use O_NOFOLLOW in utimensat if defined.
authorDarren Tucker <dtucker@dtucker.net>
Wed, 27 Mar 2019 22:26:14 +0000 (09:26 +1100)
committerDarren Tucker <dtucker@dtucker.net>
Wed, 27 Mar 2019 22:26:14 +0000 (09:26 +1100)
Fixes build on systems that don't have it (Solaris <=9)  Found by
Tom G. Christensen.

openbsd-compat/bsd-misc.c

index d3a41df50651fc7828a49af2ba60bbb435be409e..3c85a12a6f0ad9a10197aa189802c17075bfc3ba 100644 (file)
@@ -143,8 +143,10 @@ utimensat(int fd, const char *path, const struct timespec times[2],
 # ifndef HAVE_FUTIMES
        return utimes(path, tv);
 # else
+#  ifdef O_NOFOLLOW
        if (flag & AT_SYMLINK_NOFOLLOW)
                oflags |= O_NOFOLLOW;
+#  endif /* O_NOFOLLOW */
        if ((fd = open(path, oflags)) == -1)
                return -1;
        ret = futimes(fd, tv);