summaryrefslogtreecommitdiffhomepage
path: root/src/acl/ntapi_acl_helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/acl/ntapi_acl_helper.c')
-rw-r--r--src/acl/ntapi_acl_helper.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/acl/ntapi_acl_helper.c b/src/acl/ntapi_acl_helper.c
index 3059cdc..455ef1f 100644
--- a/src/acl/ntapi_acl_helper.c
+++ b/src/acl/ntapi_acl_helper.c
@@ -24,6 +24,7 @@ static nt_access_allowed_ace * __acl_ace_init(
nt_access_allowed_ace * ace,
uint32_t mask,
const nt_sid * sid,
+ uint32_t flags,
uint16_t * aces)
{
if (mask == 0)
@@ -31,7 +32,7 @@ static nt_access_allowed_ace * __acl_ace_init(
ace->mask = mask;
ace->header.ace_type = NT_ACE_TYPE_ACCESS_ALLOWED;
- ace->header.ace_flags = 0;
+ ace->header.ace_flags = flags;
ace->header.ace_size = sizeof(uint32_t) * sid->sub_authority_count
+ __offsetof(nt_access_allowed_ace,sid_start)
+ __offsetof(nt_sid,sub_authority);
@@ -55,7 +56,8 @@ void __stdcall __ntapi_acl_init_common_descriptor(
__in uint32_t group_access,
__in uint32_t other_access,
__in uint32_t admin_access,
- __in uint32_t system_access)
+ __in uint32_t system_access,
+ __in uint32_t ace_flags)
{
nt_access_allowed_ace * ace;
uint16_t ace_count = 0;
@@ -87,14 +89,14 @@ void __stdcall __ntapi_acl_init_common_descriptor(
/* ace's */
ace = (nt_access_allowed_ace *)&sd->buffer;
- ace = __acl_ace_init(ace,system_access,&sid_system,&ace_count);
- ace = __acl_ace_init(ace,owner_access,&sid_owner_rights,&ace_count);
- ace = __acl_ace_init(ace,group_access,group,&ace_count);
- ace = __acl_ace_init(ace,other_access,other,&ace_count);
+ ace = __acl_ace_init(ace,system_access,&sid_system,ace_flags,&ace_count);
+ ace = __acl_ace_init(ace,owner_access,&sid_owner_rights,ace_flags,&ace_count);
+ ace = __acl_ace_init(ace,group_access,group,ace_flags,&ace_count);
+ ace = __acl_ace_init(ace,other_access,other,ace_flags,&ace_count);
if (admin_access) {
admin = admin ? admin : (nt_sid *)&sid_admins;
- ace = __acl_ace_init(ace,admin_access,admin,&ace_count);
+ ace = __acl_ace_init(ace,admin_access,admin,ace_flags,&ace_count);
}
/* dacl */