diff options
author | Sergey Kandaurov <pluknet@nginx.com> | 2018-12-24 19:55:00 +0300 |
---|---|---|
committer | Sergey Kandaurov <pluknet@nginx.com> | 2018-12-24 19:55:00 +0300 |
commit | 499bb2655ee16e4659d571b413b1ea54fd19dcd1 (patch) | |
tree | 783cfdafc4c8f15b255f637fd3f027b8cf67df2c /src | |
parent | 2a11bf0f77358a1116b3ef56c949b242582e798c (diff) | |
download | nginx-499bb2655ee16e4659d571b413b1ea54fd19dcd1.tar.gz nginx-499bb2655ee16e4659d571b413b1ea54fd19dcd1.zip |
Userid: using stub for AF_UNIX addresses.
Previously, AF_UNIX addresses misbehaved as AF_INET, which typically resulted
in $uid_set composed from the middle of sun_path.
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/ngx_http_userid_filter_module.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_userid_filter_module.c b/src/http/modules/ngx_http_userid_filter_module.c index a1a54936b..31cf402f4 100644 --- a/src/http/modules/ngx_http_userid_filter_module.c +++ b/src/http/modules/ngx_http_userid_filter_module.c @@ -545,6 +545,13 @@ ngx_http_userid_create_uid(ngx_http_request_t *r, ngx_http_userid_ctx_t *ctx, break; #endif + +#if (NGX_HAVE_UNIX_DOMAIN) + case AF_UNIX: + ctx->uid_set[0] = 0; + break; +#endif + default: /* AF_INET */ sin = (struct sockaddr_in *) c->local_sockaddr; ctx->uid_set[0] = sin->sin_addr.s_addr; |