summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-01-05 02:18:06 +0000
committermidipix <writeonce@midipix.org>2020-01-05 02:18:06 +0000
commit36da5556024f8353f8b95dd6f486898b825378f9 (patch)
tree80886c59c5668130f6529dfde116a4bc62392bab /src
parent08c7408f2a909a3f6f69ebfbf55e64796cc868a4 (diff)
downloadntapi-36da5556024f8353f8b95dd6f486898b825378f9.tar.bz2
ntapi-36da5556024f8353f8b95dd6f486898b825378f9.tar.xz
object directory: __ipc_sd_init(): use consts, empirically remove admins acl.
Diffstat (limited to 'src')
-rw-r--r--src/object/ntapi_tt_keyed_object_directory.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/object/ntapi_tt_keyed_object_directory.c b/src/object/ntapi_tt_keyed_object_directory.c
index 6e7352e..a4835bf 100644
--- a/src/object/ntapi_tt_keyed_object_directory.c
+++ b/src/object/ntapi_tt_keyed_object_directory.c
@@ -11,6 +11,14 @@
#include <ntapi/nt_acl.h>
#include "ntapi_impl.h"
+#define __SID_SYSTEM {1,1,{{0,0,0,0,0,5}},{18}}
+#define __SID_OWNER_RIGHTS {1,1,{{0,0,0,0,0,3}},{4}}
+#define __SID_AUTHENTICATED_USERS {1,1,{{0,0,0,0,0,5}},{11}}
+
+static const nt_sid sid_system = __SID_SYSTEM;
+static const nt_sid sid_owner_rights = __SID_OWNER_RIGHTS;
+static const nt_sid sid_auth_users = __SID_AUTHENTICATED_USERS;
+
typedef ntapi_zw_open_directory_object objdir_open_fn;
static void __tt_guid_to_hex_utf16(
@@ -113,10 +121,9 @@ static void __ipc_sd_init(nt_sd_common_buffer * sd, int fdir)
/* ace's for LOCAL_SYSTEM, AUTHENTICATED_USERS, and process token user */
ace = (nt_access_allowed_ace *)&sd->buffer;
- ace = __ipc_ace_init(ace,mask_system,&(nt_sid){1,1,{{0,0,0,0,0,5}},{18}});
- ace = __ipc_ace_init(ace,mask_other,&(nt_sid){1,1,{{0,0,0,0,0,5}},{11}});
- ace = __ipc_ace_init(ace,mask_owner,(nt_sid *)&(nt_sid_os){1,2,{{0,0,0,0,0,5}},{32,544}});
- ace = __ipc_ace_init(ace,mask_owner,&(nt_sid){1,1,{{0,0,0,0,0,3}},{4}});
+ ace = __ipc_ace_init(ace,mask_system,&sid_system);
+ ace = __ipc_ace_init(ace,mask_other,&sid_auth_users);
+ ace = __ipc_ace_init(ace,mask_owner,&sid_owner_rights);
ace = __ipc_ace_init(ace,mask_owner,(nt_sid *)&sd->owner);
sd->dacl.acl_revision = 0x02;