freebsd-dev/lib/libc/tests
Kyle Evans 6a5abb1ee5 Provide O_SEARCH
O_SEARCH is defined by POSIX [0] to open a directory for searching, skipping
permissions checks on the directory itself after the initial open(). This is
close to the semantics we've historically applied for O_EXEC on a directory,
which is UB according to POSIX. Conveniently, O_SEARCH on a file is also
explicitly undefined behavior according to POSIX, so O_EXEC would be a fine
choice. The spec goes on to state that O_SEARCH and O_EXEC need not be
distinct values, but they're not defined to be the same value.

This was pointed out as an incompatibility with other systems that had made
its way into libarchive, which had assumed that O_EXEC was an alias for
O_SEARCH.

This defines compatibility O_SEARCH/FSEARCH (equivalent to O_EXEC and FEXEC
respectively) and expands our UB for O_EXEC on a directory. O_EXEC on a
directory is checked in vn_open_vnode already, so for completeness we add a
NOEXECCHECK when O_SEARCH has been specified on the top-level fd and do not
re-check that when descending in namei.

[0] https://pubs.opengroup.org/onlinepubs/9699919799/

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D23247
2020-02-02 16:34:57 +00:00
..
c063 Provide O_SEARCH 2020-02-02 16:34:57 +00:00
db DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
gen Add sigsetop extensions commonly found in musl libc and glibc 2019-12-12 01:41:55 +00:00
hash DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
iconv Remove 'All rights reserved' from my files 2018-05-09 20:12:59 +00:00
inet DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
locale DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
net Fix filename to avoid skipping lib/libc/net/servent test. 2019-07-15 23:41:00 +00:00
nss Fix various -Wpointer-compare warnings 2019-10-08 21:14:09 +00:00
regex regcomp: reduce size of bitmap for multibyte locales 2018-12-12 04:23:00 +00:00
resolv DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
rpc DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
setjmp DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
ssp Rework check for libclang_rt to see if the needed library exists. 2018-06-27 16:56:46 +00:00
stdio Conform to Berne Convention. 2018-05-22 06:22:58 +00:00
stdlib Add qsort_r(3) regression test. 2020-01-20 11:45:18 +00:00
string Avoid copying too much from the input string. 2019-07-19 23:58:30 +00:00
sys Provide separate accounting for user-wired pages. 2019-05-13 16:38:48 +00:00
termios DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
time DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
tls DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
tls_dso Update Makefile.depend files 2019-12-11 17:37:53 +00:00
ttyio DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
Makefile Connect libc/tests/time to the build, adding test cases for strptime() 2018-10-30 02:37:23 +00:00
Makefile.depend DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
Makefile.netbsd-tests Change WARNS to 2 across the board with all the libc testcases 2015-11-15 05:21:58 +00:00