diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-24 13:04:34 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-24 13:04:34 -0800 |
| commit | 5ab47e210de76d29cffbc9ea47800775a3627210 (patch) | |
| tree | 8138498b3efd5e81b96503bb14d2f79519905a88 /src/sp/transport/ipc/ipc_test.c | |
| parent | a2b6d6a544aa9934c87a6d54591faff18179858d (diff) | |
| download | nng-5ab47e210de76d29cffbc9ea47800775a3627210.tar.gz nng-5ab47e210de76d29cffbc9ea47800775a3627210.tar.bz2 nng-5ab47e210de76d29cffbc9ea47800775a3627210.zip | |
Remove the NNG_OPT_IPC_SECURITY_DESCRIPTOR option.
This is now replaced with nng_listener_set_security_descriptor
and nng_stream_listener_set_security_descriptor functions. We
may elect to remove these entirely, but for named pipe users they
are probably still quite useful. Moving towards UNIX domain sockets
would obsolete this functionality.
Diffstat (limited to 'src/sp/transport/ipc/ipc_test.c')
| -rw-r--r-- | src/sp/transport/ipc/ipc_test.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/sp/transport/ipc/ipc_test.c b/src/sp/transport/ipc/ipc_test.c index 6a4021a0..51eb975d 100644 --- a/src/sp/transport/ipc/ipc_test.c +++ b/src/sp/transport/ipc/ipc_test.c @@ -674,6 +674,26 @@ test_ipc_pipe_peer(void) #endif // NNG_PLATFORM_POSIX } +void +test_ipc_security_descriptor(void) +{ + nng_socket s; + nng_listener l; + char *addr; + + NUTS_ADDR(addr, "ipc"); + NUTS_OPEN(s); + NUTS_PASS(nng_listener_create(&l, s, addr)); +#ifdef NNG_PLATFORM_WINDOWS + // not a security descriptor + NUTS_FAIL(nng_listener_set_security_descriptor(l, addr), NNG_EINVAL); +#else + // not appropriate + NUTS_FAIL(nng_listener_set_security_descriptor(l, addr), NNG_ENOTSUP); +#endif + NUTS_CLOSE(s); +} + TEST_LIST = { { "ipc path too long", test_path_too_long }, { "ipc dialer perms", test_ipc_dialer_perms }, @@ -696,5 +716,6 @@ TEST_LIST = { { "ipc abstract embedded null", test_abstract_null }, { "ipc unix alias", test_unix_alias }, { "ipc peer id", test_ipc_pipe_peer }, + { "ipc security descriptor", test_ipc_security_descriptor }, { NULL, NULL }, }; |
