]> git.kaiwu.me - nginx.git/commitdiff
Userid: using stub for AF_UNIX addresses.
authorSergey Kandaurov <pluknet@nginx.com>
Mon, 24 Dec 2018 16:55:00 +0000 (19:55 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Mon, 24 Dec 2018 16:55:00 +0000 (19:55 +0300)
Previously, AF_UNIX addresses misbehaved as AF_INET, which typically resulted
in $uid_set composed from the middle of sun_path.

src/http/modules/ngx_http_userid_filter_module.c

index a1a54936bd676c2d4d668cefcf5bfb4bfdc63f28..31cf402f4b1fd3d80f9f734564df59869626d7e0 100644 (file)
@@ -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;