Tests: workaround for freebsd 8 in disable_symlinks tests. There are no O_SEARCH on FreeBSD yet, and we use O_EXEC|O_DIRECTORY instead. Unfortunately on FreeBSD 8 the O_DIRECTORY flag does nothing, and as a result openat(O_EXEC) fails with EACCESS while trying to open a file. Workaround is to make the file executable, thus allowing it to correctly fail with ENOTDIR on next call.
diff --git a/http_disable_symlinks.t b/http_disable_symlinks.t index cf2cfb3..ff4dbb8 100644 --- a/http_disable_symlinks.t +++ b/http_disable_symlinks.t
@@ -246,6 +246,12 @@ like(http_get('/complex/2/empty.html'), qr!200 OK!, 'complex root 2'); like(http_get('/complex/3/empty.html'), qr!200 OK!, 'complex root 3'); +# workaround for freebsd 8: we use O_EXEC instead of O_SEARCH (since there +# is no O_SEARCH), and O_DIRECTORY does nothing. setting the 'x' bit +# tests to pass as openat() will correctly fail with ENOTDIR + +chmod(0700, "$d/link"); + like(http_get('/link/tail'), qr!403 !, 'file with trailing /, on'); like(http_get('/link/tailowner'), qr!404 !, 'file with trailing /, owner'); like(http_get('/link/tailoff'), qr!404 !, 'file with trailing /, off');