From f526e8e7fd22c00734c5ce17a1cb4bf8e540af92 Mon Sep 17 00:00:00 2001 From: Vladislav Grishenko Date: Tue, 27 Feb 2018 22:35:41 +0500 Subject: sstp: allow access to unix socket to anyone almost the same as ipv4/ipv6 is accessible by anyone for easier access under multiple proxy effective users. --- accel-pppd/ctrl/sstp/sstp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/accel-pppd/ctrl/sstp/sstp.c b/accel-pppd/ctrl/sstp/sstp.c index 71accc3d..1edbc66b 100644 --- a/accel-pppd/ctrl/sstp/sstp.c +++ b/accel-pppd/ctrl/sstp/sstp.c @@ -2430,6 +2430,12 @@ static void sstp_init(void) goto error_close; } + if (addr->u.sa.sa_family == AF_UNIX && addr->u.sun.sun_path[0] && + chmod(addr->u.sun.sun_path, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) < 0) { + log_warn("sstp: failed to set socket permissions: %s\n", strerror(errno)); + } + if (listen(serv.hnd.fd, 10) < 0) { log_emerg("sstp: failed to listen socket: %s\n", strerror(errno)); goto error_unlink; -- cgit v1.2.3