diff --git a/lib/plat/unix/unix-caps.c b/lib/plat/unix/unix-caps.c index 6465b9543..8962b9537 100644 --- a/lib/plat/unix/unix-caps.c +++ b/lib/plat/unix/unix-caps.c @@ -78,7 +78,7 @@ lws_plat_user_colon_group_to_ids(const char *u_colon_g, uid_t *puid, gid_t *pgid p = getpwnam(u); if (!p) { - lwsl_err("%s: unknown group '%s'\n", __func__, u); + lwsl_err("%s: unknown user '%s'\n", __func__, u); return 1; } diff --git a/lib/secure-streams/secure-streams-client.c b/lib/secure-streams/secure-streams-client.c index 8555a3e05..70d7ff785 100644 --- a/lib/secure-streams/secure-streams-client.c +++ b/lib/secure-streams/secure-streams-client.c @@ -40,7 +40,11 @@ lws_sspc_sul_retry_cb(lws_sorted_usec_list_t *sul) if (h->context->ss_proxy_bind) i.address = h->context->ss_proxy_bind; else +#if defined(__linux__) i.address = "+@proxy.ss.lws"; +#else + i.address = "+/tmp/proxy.ss.lws"; +#endif } i.host = i.address; i.origin = i.address; diff --git a/lib/secure-streams/secure-streams-process.c b/lib/secure-streams/secure-streams-process.c index e04fcfcc3..7c3185df2 100644 --- a/lib/secure-streams/secure-streams-process.c +++ b/lib/secure-streams/secure-streams-process.c @@ -585,11 +585,18 @@ lws_ss_proxy_create(struct lws_context *context, const char *bind, int port) info.port = port; if (!port) { if (!bind) +#if defined(__linux__) bind = "@proxy.ss.lws"; +#else + bind = "/tmp/proxy.ss.lws"; +#endif info.options |= LWS_SERVER_OPTION_UNIX_SOCK; } info.iface = bind; +#if defined(__linux__) info.unix_socket_perms = "root:root"; +#else +#endif info.listen_accept_role = "raw-skt"; info.listen_accept_protocol = "ssproxy-protocol"; info.protocols = protocols; diff --git a/minimal-examples/secure-streams/minimal-secure-streams/CMakeLists.txt b/minimal-examples/secure-streams/minimal-secure-streams/CMakeLists.txt index 1a731c6c8..1f532853b 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams/CMakeLists.txt +++ b/minimal-examples/secure-streams/minimal-secure-streams/CMakeLists.txt @@ -17,12 +17,51 @@ require_lws_config(LWS_WITH_SYS_STATE 1 requirements) if (requirements) add_executable(${SAMP} minimal-secure-streams.c) - if (LWS_CTEST_INTERNET_AVAILABLE) + if (LWS_CTEST_INTERNET_AVAILABLE AND NOT WIN32) add_test(NAME ss-warmcat COMMAND lws-minimal-secure-streams) set_tests_properties(ss-warmcat PROPERTIES WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams TIMEOUT 20) + + if (HAS_LWS_WITH_SECURE_STREAMS_PROXY_API OR LWS_WITH_SECURE_STREAMS_PROXY_API) + + # + # Define test dep to bring up and take down the test + # proxy + # + + if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + # uds abstract namespace for linux + set(CTEST_SOCKET_PATH "@ctest-ssp-$ENV{SAI_PROJECT}-$ENV{SAI_OVN}") + else() + # filesystem socket for others + set(CTEST_SOCKET_PATH "/tmp/ctest-ssp-$ENV{SAI_PROJECT}-$ENV{SAI_OVN}") + endif() + add_test(NAME st_ssproxy COMMAND + ${CMAKE_SOURCE_DIR}/scripts/ctest-background.sh + ssproxy $ + -i ${CTEST_SOCKET_PATH} --ignore-sigterm) + set_tests_properties(st_ssproxy PROPERTIES WORKING_DIRECTORY . FIXTURES_SETUP ssproxy TIMEOUT 800) + + add_test(NAME ki_ssproxy COMMAND + ${CMAKE_SOURCE_DIR}/scripts/ctest-background-kill.sh + ssproxy $ + -i ${CTEST_SOCKET_PATH}) + set_tests_properties(ki_ssproxy PROPERTIES FIXTURES_CLEANUP ssproxy) + + # + # the client part that will connect to the proxy + # + + add_test(NAME sspc-minimal COMMAND lws-minimal-secure-streams-client -i +${CTEST_SOCKET_PATH}) + set_tests_properties(sspc-minimal PROPERTIES + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams + FIXTURES_REQUIRED "ssproxy" + TIMEOUT 40) + + endif() + endif() if (websockets_shared)