comparison http_disable_symlinks.t @ 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
comparison
equal deleted inserted replaced
204:d838248b643a 205:606a4df68952
244 244
245 like(http_get('/complex/1/empty.html'), qr!200 OK!, 'complex root 1'); 245 like(http_get('/complex/1/empty.html'), qr!200 OK!, 'complex root 1');
246 like(http_get('/complex/2/empty.html'), qr!200 OK!, 'complex root 2'); 246 like(http_get('/complex/2/empty.html'), qr!200 OK!, 'complex root 2');
247 like(http_get('/complex/3/empty.html'), qr!200 OK!, 'complex root 3'); 247 like(http_get('/complex/3/empty.html'), qr!200 OK!, 'complex root 3');
248 248
249 # workaround for freebsd 8: we use O_EXEC instead of O_SEARCH (since there
250 # is no O_SEARCH), and O_DIRECTORY does nothing. setting the 'x' bit
251 # tests to pass as openat() will correctly fail with ENOTDIR
252
253 chmod(0700, "$d/link");
254
249 like(http_get('/link/tail'), qr!403 !, 'file with trailing /, on'); 255 like(http_get('/link/tail'), qr!403 !, 'file with trailing /, on');
250 like(http_get('/link/tailowner'), qr!404 !, 'file with trailing /, owner'); 256 like(http_get('/link/tailowner'), qr!404 !, 'file with trailing /, owner');
251 like(http_get('/link/tailoff'), qr!404 !, 'file with trailing /, off'); 257 like(http_get('/link/tailoff'), qr!404 !, 'file with trailing /, off');
252 258
253 like(http_get('/dirlink'), qr!404 !, 'directory without /'); 259 like(http_get('/dirlink'), qr!404 !, 'directory without /');