summaryrefslogtreecommitdiffhomepage
path: root/src/stream
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2017-12-13 20:40:53 +0300
committerRoman Arutyunyan <arut@nginx.com>2017-12-13 20:40:53 +0300
commit752f66bf7d70fae2bf05fbf5941ff4be52b2b9a5 (patch)
tree78fc3bcc2f52d8fc71fa4ec12080fdf891e0a113 /src/stream
parentd2d737e70b46429ef9ed71b99402a9151f3c2e1f (diff)
downloadnginx-752f66bf7d70fae2bf05fbf5941ff4be52b2b9a5.tar.gz
nginx-752f66bf7d70fae2bf05fbf5941ff4be52b2b9a5.tar.bz2
Retain CAP_NET_RAW capability for transparent proxying.
The capability is retained automatically in unprivileged worker processes after changing UID if transparent proxying is enabled at least once in nginx configuration. The feature is only available in Linux.
Diffstat (limited to 'src/stream')
-rw-r--r--src/stream/ngx_stream_proxy_module.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/stream/ngx_stream_proxy_module.c b/src/stream/ngx_stream_proxy_module.c
index ad81cc8b7..818d7329b 100644
--- a/src/stream/ngx_stream_proxy_module.c
+++ b/src/stream/ngx_stream_proxy_module.c
@@ -2155,6 +2155,12 @@ ngx_stream_proxy_bind(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (cf->args->nelts > 2) {
if (ngx_strcmp(value[2].data, "transparent") == 0) {
#if (NGX_HAVE_TRANSPARENT_PROXY)
+ ngx_core_conf_t *ccf;
+
+ ccf = (ngx_core_conf_t *) ngx_get_conf(cf->cycle->conf_ctx,
+ ngx_core_module);
+
+ ccf->transparent = 1;
local->transparent = 1;
#else
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,