Mercurial > hg > nginx-tests
changeset 205:606a4df68952
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 21 Feb 2012 16:58:21 +0000 |
parents | d838248b643a |
children | 9963da7397cc |
files | http_disable_symlinks.t |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/http_disable_symlinks.t +++ b/http_disable_symlinks.t @@ -246,6 +246,12 @@ like(http_get('/complex/1/empty.html'), 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');