Only use faccessat(3) if AT_EACCESS is defined.

Apparently Android (bionic) has faccessat() but not AT_EACCESS.
Bug #940.
This commit is contained in:
Todd C. Miller
2020-09-17 20:17:38 -06:00
parent 4f1fff953b
commit 90bcae7986

View File

@@ -85,7 +85,7 @@ switch_user(uid_t euid, gid_t egid, int ngroups, GETGROUPS_T *groups)
debug_return;
}
#ifdef HAVE_FACCESSAT
#if defined(HAVE_FACCESSAT) && defined(AT_EACCESS)
/*
* Returns true if the open directory fd is owned or writable by the user.
*/
@@ -193,7 +193,7 @@ dir_is_writable(int dfd, struct user_details *ud, struct command_details *cd)
errno = EACCES;
debug_return_int(false);
}
#endif /* HAVE_FACCESSAT */
#endif /* HAVE_FACCESSAT && AT_EACCESS */
/*
* Find our temporary directory, one of /var/tmp, /usr/tmp, or /tmp