diff options
author | Marcus Rückert <darix@opensu.se> | 2006-09-07 11:00:02 +0000 |
---|---|---|
committer | Marcus Rückert <darix@opensu.se> | 2006-09-07 11:00:02 +0000 |
commit | 9dd8a6036669a279796d5e98e1aa2d476ba1a306 (patch) | |
tree | a86b868ab977928eba8e912eee2b77b824d237b6 /src/mod_staticfile.c | |
parent | a4f30c52877312098594d4dfc7a128cbf5fb9949 (diff) | |
download | lighttpd-git-9dd8a6036669a279796d5e98e1aa2d476ba1a306.tar.gz |
- backport symlink patch in hard version to 1.4.11
git-svn-id: svn+ssh://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.11-ssl-fixes@1281 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'src/mod_staticfile.c')
-rw-r--r-- | src/mod_staticfile.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mod_staticfile.c b/src/mod_staticfile.c index 6fac65b1..f5308cd7 100644 --- a/src/mod_staticfile.c +++ b/src/mod_staticfile.c @@ -397,6 +397,19 @@ URIHANDLER_FUNC(mod_staticfile_subrequest) { } /* we only handline regular files */ +#ifdef HAVE_LSTAT + if ((sce->is_symlink == 1) && !con->conf.follow_symlink) { + con->http_status = 403; + + if (con->conf.log_request_handling) { + log_error_write(srv, __FILE__, __LINE__, "s", "-- access denied due symlink restriction"); + log_error_write(srv, __FILE__, __LINE__, "sb", "Path :", con->physical.path); + } + + buffer_reset(con->physical.path); + return HANDLER_FINISHED; + } +#endif if (!S_ISREG(sce->st.st_mode)) { con->http_status = 404; |