[PATCH] Unix domain sockets in abstract namespace

Dirk Feytons dirk.feytons at gmail.com
Wed Sep 12 09:46:52 UTC 2012


I was playing around with ngx_lua and its socket API, which is built
on top of nginx functionality. The API supports unix domain sockets
but not in the abstract namespace, at least not officially. When I
tried specifying an abstract address I found it didn't work. I tracked
it down to two calls to ngx_cpystrn() in
core/ngx_inet.c:ngx_parse_unix_domain_url(). That function gets
confused by the leading '\0' in an abstract namespace address.
Changing it to ngx_memcpy() fixes this and then everything works.

I attached a patch agains nginx 1.2.3. The fix seems trivial but this
is my first look into the nginx internals so I don't know whether
there are unwanted side effects from this change. Feedback welcome.


Dirk F.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nginx-1.2.3-abstract-unix-domain-socket.patch
Type: application/octet-stream
Size: 911 bytes
Desc: not available
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20120912/3592875c/attachment.obj>

More information about the nginx-devel mailing list