[nginx] Userid: using stub for AF_UNIX addresses.

Sergey Kandaurov pluknet at nginx.com
Mon Dec 24 17:13:59 UTC 2018


details:   https://hg.nginx.org/nginx/rev/ecc97cb0eda4
branches:  
changeset: 7432:ecc97cb0eda4
user:      Sergey Kandaurov <pluknet at nginx.com>
date:      Mon Dec 24 19:55:00 2018 +0300
description:
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:

 src/http/modules/ngx_http_userid_filter_module.c |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (17 lines):

diff -r 294162223c7c -r ecc97cb0eda4 src/http/modules/ngx_http_userid_filter_module.c
--- a/src/http/modules/ngx_http_userid_filter_module.c	Tue Dec 18 15:15:15 2018 +0300
+++ b/src/http/modules/ngx_http_userid_filter_module.c	Mon Dec 24 19:55:00 2018 +0300
@@ -545,6 +545,13 @@ ngx_http_userid_create_uid(ngx_http_requ
 
                 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;


More information about the nginx-devel mailing list