diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b5288b32..5c140c88e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ option(LWS_WITH_HTTP2 "Compile with server support for HTTP/2" OFF) option(LWS_WITH_LWSWS "Libwebsockets Webserver" OFF) option(LWS_WITH_CGI "Include CGI (spawn process with network-connected stdin/out/err) APIs" OFF) option(LWS_IPV6 "Compile with support for ipv6" OFF) -option(LWS_UNIX_SOCK "Compile with support for UNIX domain socket" OFF) +option(LWS_UNIX_SOCK "Compile with support for UNIX domain socket" ON) option(LWS_WITH_PLUGINS "Support plugins for protocols and extensions" OFF) option(LWS_WITH_HTTP_PROXY "Support for rewriting HTTP proxying (requires libhubbub)" OFF) option(LWS_WITH_ZIP_FOPS "Support serving pre-zipped files" OFF) diff --git a/lib/core/libwebsockets.c b/lib/core/libwebsockets.c index eeb9e168f..351db79ad 100644 --- a/lib/core/libwebsockets.c +++ b/lib/core/libwebsockets.c @@ -2593,9 +2593,11 @@ lws_socket_bind(struct lws_vhost *vhost, lws_sockfd_type sockfd, int port, } #if defined(LWS_WITH_UNIX_SOCK) - if (LWS_UNIX_SOCK_ENABLED(vhost) && vhost->context->uid) { - chown(serv_unix.sun_path, vhost->context->uid, vhost->context->gid); - } + if (LWS_UNIX_SOCK_ENABLED(vhost) && vhost->context->uid) + if (chown(serv_unix.sun_path, vhost->context->uid, + vhost->context->gid)) + lwsl_notice("%s: chown for unix skt %s failed\n", + __func__, serv_unix.sun_path); #endif #ifndef LWS_PLAT_OPTEE