summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2022-12-15 11:58:11 +1300
committerAndrew Bartlett <abartlet@samba.org>2023-02-08 00:03:39 +0000
commit5147f011d9b2b37dd46939d4b50d71d50a6776c1 (patch)
tree8bc905a41fb9da6e6f3a916b6982f41b4860b7a7 /auth
parente3fdb2d00152d86558a2ba29b92fd36440055461 (diff)
downloadsamba-5147f011d9b2b37dd46939d4b50d71d50a6776c1.tar.gz
auth: Shorten long SID flags combinations
The combination MANDATORY | ENABLED_BY_DEFAULT | ENABLED is very commonly used, and introducing a shorter alias for it makes the code clearer. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'auth')
-rw-r--r--auth/auth_sam_reply.c6
-rw-r--r--auth/wbc_auth_util.c8
2 files changed, 4 insertions, 10 deletions
diff --git a/auth/auth_sam_reply.c b/auth/auth_sam_reply.c
index 850ccae980b..72edf0eed15 100644
--- a/auth/auth_sam_reply.c
+++ b/auth/auth_sam_reply.c
@@ -677,8 +677,7 @@ NTSTATUS make_user_info_dc_netlogon_validation(TALLOC_CTX *mem_ctx,
if (!sid_append_rid(&user_info_dc->sids[PRIMARY_USER_SID_INDEX].sid, base->rid)) {
return NT_STATUS_INVALID_PARAMETER;
}
- user_info_dc->sids[PRIMARY_USER_SID_INDEX].attrs
- = SE_GROUP_MANDATORY | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_ENABLED;
+ user_info_dc->sids[PRIMARY_USER_SID_INDEX].attrs = SE_GROUP_DEFAULT_FLAGS;
user_info_dc->sids[PRIMARY_GROUP_SID_INDEX].sid = *base->domain_sid;
if (!sid_append_rid(&user_info_dc->sids[PRIMARY_GROUP_SID_INDEX].sid, base->primary_gid)) {
@@ -690,8 +689,7 @@ NTSTATUS make_user_info_dc_netlogon_validation(TALLOC_CTX *mem_ctx,
* group in the first place, and besides, these attributes will never
* make their way into a PAC.
*/
- user_info_dc->sids[PRIMARY_GROUP_SID_INDEX].attrs
- = SE_GROUP_MANDATORY | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_ENABLED;
+ user_info_dc->sids[PRIMARY_GROUP_SID_INDEX].attrs = SE_GROUP_DEFAULT_FLAGS;
for (i = 0; i < base->groups.count; i++) {
/* Skip primary group, already added above */
diff --git a/auth/wbc_auth_util.c b/auth/wbc_auth_util.c
index 52573e2a773..311052c9108 100644
--- a/auth/wbc_auth_util.c
+++ b/auth/wbc_auth_util.c
@@ -50,9 +50,7 @@ static NTSTATUS wbcsids_to_samr_RidWithAttributeArray(
&groups->rids[j].rid);
if (!ok) continue;
- groups->rids[j].attributes = SE_GROUP_MANDATORY |
- SE_GROUP_ENABLED_BY_DEFAULT |
- SE_GROUP_ENABLED;
+ groups->rids[j].attributes = SE_GROUP_DEFAULT_FLAGS;
j++;
}
@@ -91,9 +89,7 @@ static NTSTATUS wbcsids_to_netr_SidAttrArray(
talloc_free(info3_sids);
return NT_STATUS_NO_MEMORY;
}
- info3_sids[j].attributes = SE_GROUP_MANDATORY |
- SE_GROUP_ENABLED_BY_DEFAULT |
- SE_GROUP_ENABLED;
+ info3_sids[j].attributes = SE_GROUP_DEFAULT_FLAGS;
j++;
}