Welcome! Log In Create A New Profile

Advanced

[PATCH] updated support for unix socket in abstract namespace

All files from this thread

File Name File Size   Posted by Date  
nginx_unix_abstract.patch 1.8 KB open | download roberto 06/04/2011 Read message
June 04, 2011 01:30AM
Hi all,
attached there is an updated patch for adding support for unix socket in
abstract namespace.

As requested by Igor, the syntax is now

unix:\0foobar

instead of

unix:@foobar

The only relevant note is this part of code:

+ if (saun->sun_path[0] != '\0') {
+ u->addrs[0].socklen = sizeof(struct sockaddr_un);
+ }
+ else {
+ u->addrs[0].socklen = sizeof(saun->sun_family) + len;
+ }


it looks like using

u->addrs[0].socklen = sizeof(saun->sun_family) + len;

is not reliable in all os (NetBSD and OpenBSD in my tests did not work) so
i think
an exception (as i did) is more "secure".

Probably, as linux is the only os supporting abstract namespace, we could
use:

#ifdef __linux__
u->addrs[0].socklen = sizeof(saun->sun_family) + len;
#else
u->addrs[0].socklen = sizeof(struct sockaddr_un);
#endif

--
Roberto De Ioris
http://unbit.it_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Attachments:
open | download - nginx_unix_abstract.patch (1.8 KB)
Subject Author Posted

[PATCH] updated support for unix socket in abstract namespace Attachments

roberto June 04, 2011 01:30AM

Re: [PATCH] updated support for unix socket in abstract namespace

Igor Sysoev June 04, 2011 01:50AM

Re: [PATCH] updated support for unix socket in abstract namespace

roberto June 04, 2011 02:22AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 281
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready