summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-03-20 00:02:48 +0000
committermidipix <writeonce@midipix.org>2018-03-20 23:27:58 -0400
commit10276e6704ad4da70de0cec3703ac3a899c519eb (patch)
treea48d4e466b26a6bd246f16627122d3ccce3a8862 /src
parent9a95bf181c3cd3fec22c24a6d99129a2fa01bcaa (diff)
downloadntapi-10276e6704ad4da70de0cec3703ac3a899c519eb.tar.bz2
ntapi-10276e6704ad4da70de0cec3703ac3a899c519eb.tar.xz
sysv semaphore: open ipc directory with minimally required access.
Diffstat (limited to 'src')
-rw-r--r--src/sem/ntapi_sem_connect.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sem/ntapi_sem_connect.c b/src/sem/ntapi_sem_connect.c
index 33a4541..71344b9 100644
--- a/src/sem/ntapi_sem_connect.c
+++ b/src/sem/ntapi_sem_connect.c
@@ -103,7 +103,11 @@ static int32_t __sempid_symlink_set(
if (!rtdata->hsempiddir) {
if ((status = __ntapi->tt_open_ipc_object_directory(
&hpiddir,
- NT_DIRECTORY_ALL_ACCESS,
+ NT_SEC_READ_CONTROL
+ | NT_DIRECTORY_QUERY
+ | NT_DIRECTORY_TRAVERSE
+ | NT_DIRECTORY_CREATE_OBJECT
+ | NT_DIRECTORY_CREATE_SUBDIRECTORY,
p_sempid,&g_sempid)))
return status;
@@ -294,7 +298,7 @@ int32_t __stdcall __ntapi_sem_open(
status = __ntapi->zw_open_symbolic_link_object(
&hsymlink,
- NT_SEC_STANDARD_RIGHTS_READ | NT_GENERIC_READ,
+ NT_SYMBOLIC_LINK_QUERY,
&ipcoa);
switch (status) {