comparison http_disable_symlinks.t @ 207:0a9e5d753fb8

Tests: accept 404 on file link open with trailing slash. It's unspecified whether ENOTDIR or ELOOP/EMLINKS will be returned if both O_DIRECTORY and O_NOFOLLOW are set, so we accept both return codes (and 403 and 404 http status codes accordingly).
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 29 Feb 2012 13:09:30 +0100
parents 9963da7397cc
children 6a0d934950bc
comparison
equal deleted inserted replaced
206:9963da7397cc 207:0a9e5d753fb8
265 # is no O_SEARCH), and O_DIRECTORY does nothing. setting the 'x' bit 265 # is no O_SEARCH), and O_DIRECTORY does nothing. setting the 'x' bit
266 # tests to pass as openat() will correctly fail with ENOTDIR 266 # tests to pass as openat() will correctly fail with ENOTDIR
267 267
268 chmod(0700, "$d/link"); 268 chmod(0700, "$d/link");
269 269
270 like(http_get('/link/tail'), qr!403 !, 'file with trailing /, on'); 270 like(http_get('/link/tail'), qr!40[34] !, 'file with trailing /, on');
271 like(http_get('/link/tailowner'), qr!404 !, 'file with trailing /, owner'); 271 like(http_get('/link/tailowner'), qr!404 !, 'file with trailing /, owner');
272 like(http_get('/link/tailoff'), qr!404 !, 'file with trailing /, off'); 272 like(http_get('/link/tailoff'), qr!404 !, 'file with trailing /, off');
273 273
274 like(http_get('/dirlink'), qr!404 !, 'directory without /'); 274 like(http_get('/dirlink'), qr!404 !, 'directory without /');
275 like(http_get('/dirlink/'), qr!404 !, 'directory with trailing /'); 275 like(http_get('/dirlink/'), qr!404 !, 'directory with trailing /');