diff options
author | Andrey Belov <defan@nginx.com> | 2012-02-13 16:29:04 +0000 |
---|---|---|
committer | Andrey Belov <defan@nginx.com> | 2012-02-13 16:29:04 +0000 |
commit | bd1e719bf9c4bc58076e7b52e87be645c9b803f5 (patch) | |
tree | f1c94ff9e91e2d2594ba9d1ae7f92120cca36722 /src/http/ngx_http_core_module.h | |
parent | 32c8df44d5f53026d92ec24bcf4c864359395e55 (diff) | |
download | nginx-bd1e719bf9c4bc58076e7b52e87be645c9b803f5.tar.gz nginx-bd1e719bf9c4bc58076e7b52e87be645c9b803f5.zip |
Added disable_symlinks directive.
To completely disable symlinks (disable_symlinks on)
we use openat(O_NOFOLLOW) for each path component
to avoid races.
To allow symlinks with the same owner (disable_symlinks if_not_owner),
use openat() (followed by fstat()) and fstatat(AT_SYMLINK_NOFOLLOW),
and then compare uids between fstat() and fstatat().
As there is a race between openat() and fstatat() we don't
know if openat() in fact opened symlink or not. Therefore,
we have to compare uids even if fstatat() reports the opened
component isn't a symlink (as we don't know whether it was
symlink during openat() or not).
Default value is off, i.e. symlinks are allowed.
Diffstat (limited to 'src/http/ngx_http_core_module.h')
-rw-r--r-- | src/http/ngx_http_core_module.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/http/ngx_http_core_module.h b/src/http/ngx_http_core_module.h index 38f58dfcb..3d6408a1e 100644 --- a/src/http/ngx_http_core_module.h +++ b/src/http/ngx_http_core_module.h @@ -404,6 +404,10 @@ struct ngx_http_core_loc_conf_s { #endif #endif +#if (NGX_HAVE_OPENAT) + ngx_uint_t disable_symlinks; /* disable_symlinks */ +#endif + ngx_array_t *error_pages; /* error_page */ ngx_http_try_file_t *try_files; /* try_files */ |