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/platform/windows/win_ipc_sec_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/platform/windows/win_ipc_sec_test.c')
| -rw-r--r-- | src/platform/windows/win_ipc_sec_test.c | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/src/platform/windows/win_ipc_sec_test.c b/src/platform/windows/win_ipc_sec_test.c index ab65533b..8b76770e 100644 --- a/src/platform/windows/win_ipc_sec_test.c +++ b/src/platform/windows/win_ipc_sec_test.c @@ -1,5 +1,5 @@ // -// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a @@ -72,12 +72,12 @@ test_ipc_security_descriptor(void) NUTS_ASSERT(acl != NULL); NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL)); - NUTS_PASS(nng_stream_listener_set_ptr( - l, NNG_OPT_IPC_SECURITY_DESCRIPTOR, sd)); + NUTS_PASS(nng_stream_listener_set_security_descriptor(l, sd)); NUTS_PASS(nng_stream_listener_listen(l)); nng_stream_listener_accept(l, aio); - (void) snprintf(pipe, sizeof(pipe), "\\\\.\\pipe\\%s", address+strlen("ipc://")); + (void) snprintf( + pipe, sizeof(pipe), "\\\\.\\pipe\\%s", address + strlen("ipc://")); HANDLE ph = CreateFileA(pipe, READ_CONTROL, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); @@ -132,9 +132,8 @@ test_ipc_security_descriptor_busy(void) NUTS_PASS(nng_stream_listener_listen(l)); - NUTS_FAIL(nng_stream_listener_set_ptr( - l, NNG_OPT_IPC_SECURITY_DESCRIPTOR, sd), - NNG_EBUSY); + NUTS_FAIL( + nng_stream_listener_set_security_descriptor(l, sd), NNG_EBUSY); free(sd); nng_stream_listener_close(l); @@ -151,40 +150,17 @@ test_ipc_security_descriptor_bogus(void) NUTS_PASS(nng_stream_listener_alloc(&l, address)); - NUTS_FAIL(nng_stream_listener_set_ptr( - l, NNG_OPT_IPC_SECURITY_DESCRIPTOR, NULL), - NNG_EINVAL); + NUTS_FAIL( + nng_stream_listener_set_security_descriptor(l, NULL), NNG_EINVAL); nng_stream_listener_close(l); nng_stream_listener_free(l); } -void -test_ipc_security_descriptor_dialer(void) -{ - nng_stream_dialer *d; - char address[64]; - SECURITY_DESCRIPTOR *sdesc; - - nuts_scratch_addr("ipc", sizeof(address), address); - NUTS_PASS(nng_stream_dialer_alloc(&d, address)); - - sdesc = calloc(SECURITY_DESCRIPTOR_MIN_LENGTH, 1); - NUTS_ASSERT(sdesc != NULL); - InitializeSecurityDescriptor(sdesc, SECURITY_DESCRIPTOR_REVISION); - NUTS_FAIL(nng_stream_dialer_set_ptr( - d, NNG_OPT_IPC_SECURITY_DESCRIPTOR, sdesc), - NNG_ENOTSUP); - free(sdesc); - nng_stream_dialer_free(d); -} - NUTS_TESTS = { { "ipc security descriptor", test_ipc_security_descriptor }, { "ipc security descriptor busy", test_ipc_security_descriptor_busy }, { "ipc security descriptor bogus", test_ipc_security_descriptor_bogus }, - { "ipc security descriptor dialer", - test_ipc_security_descriptor_dialer }, { NULL, NULL }, }; |
