diff options
author | Eric Blake <eblake@redhat.com> | 2009-09-25 13:44:45 +0000 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2009-09-25 13:44:45 +0000 |
commit | 3dbe243afa103716b4f6e227087d447afdd09fad (patch) | |
tree | 22968367aeda9510d05198488749af53faa0a710 /winsup/cygwin/spawn.cc | |
parent | 5386cd8ecc95e8f8e69460edac473236caa5e9fe (diff) | |
download | cygnal-3dbe243afa103716b4f6e227087d447afdd09fad.tar.gz cygnal-3dbe243afa103716b4f6e227087d447afdd09fad.tar.bz2 cygnal-3dbe243afa103716b4f6e227087d447afdd09fad.zip |
Fix faccessat(,0) and access() semantics.
* fhandler.h (fhandler_base::fhaccess): Add parameter.
* security.h (check_file_access, check_registry_access): Likewise.
* security.cc (check_file_access, check_registry_access)
(check_access): Implement new parameter.
* fhandler.cc (fhandler_base::fhaccess): Likewise.
(device_access_denied): Update caller.
* syscalls.cc (access, faccessat): Update callers.
* spawn.cc (find_exec, fixup): Likewise.
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r-- | winsup/cygwin/spawn.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index c5b5bee9a..5c86c4b5c 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -169,7 +169,7 @@ find_exec (const char *name, path_conv& buf, const char *mywinenv, if ((suffix = perhaps_suffix (tmp, buf, err, opt)) != NULL) { - if (buf.has_acls () && check_file_access (buf, X_OK)) + if (buf.has_acls () && check_file_access (buf, X_OK, true)) continue; if (posix == tmp) @@ -1083,7 +1083,8 @@ just_shell: /* Check if script is executable. Otherwise we start non-executable scripts successfully, which is incorrect behaviour. */ - if (real_path.has_acls () && check_file_access (real_path, X_OK) < 0) + if (real_path.has_acls () + && check_file_access (real_path, X_OK, true) < 0) return -1; /* errno is already set. */ /* Replace argv[0] with the full path to the script if this is the |