Mercurial > hg > nginx-tests
changeset 577:90f9b128b218
Tests: handled legacy 'darwin' behavior in disable_symlinks tests.
Unlike stated in the newer Open Group Base Specifications Issue 7, opening
a symlink to the non-directory entry with a trailing slash would succeed in
'darwin'-like systems:
[ENOTDIR] <..>the path argument contains at least one non- <slash> character
and ends with one or more trailing <slash> characters, and the last pathname
component names an existing file that is neither a directory nor a symbolic
link to a directory<..>
See for details how it was fixed in FreeBSD 7+: http://bugs.freebsd.org/21768
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 18 May 2015 12:05:04 +0300 |
parents | 239ade56c015 |
children | 8504a62496df |
files | http_disable_symlinks.t |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/http_disable_symlinks.t Thu May 14 17:28:52 2015 +0300 +++ b/http_disable_symlinks.t Mon May 18 12:05:04 2015 +0300 @@ -259,10 +259,11 @@ # tests to pass as openat() will correctly fail with ENOTDIR chmod(0700, "$d/link"); +my $rc = $^O eq 'darwin' ? 200 : 404; like(http_get('/link/tail'), qr!40[34] !, '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'); +like(http_get('/link/tailoff'), qr!$rc !, 'file with trailing /, off'); like(http_get('/dirlink'), qr!404 !, 'directory without /'); like(http_get('/dirlink/'), qr!404 !, 'directory with trailing /');