diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2022-12-15 11:58:11 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2023-02-08 00:03:39 +0000 |
commit | 5147f011d9b2b37dd46939d4b50d71d50a6776c1 (patch) | |
tree | 8bc905a41fb9da6e6f3a916b6982f41b4860b7a7 /source4/rpc_server | |
parent | e3fdb2d00152d86558a2ba29b92fd36440055461 (diff) | |
download | samba-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 'source4/rpc_server')
-rw-r--r-- | source4/rpc_server/samr/dcesrv_samr.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c index b1342cbfe84..2df9312fe31 100644 --- a/source4/rpc_server/samr/dcesrv_samr.c +++ b/source4/rpc_server/samr/dcesrv_samr.c @@ -2356,7 +2356,7 @@ static NTSTATUS dcesrv_samr_QueryGroupInfo(struct dcesrv_call_state *dce_call, T switch (r->in.level) { case GROUPINFOALL: QUERY_STRING(msg, all.name, "sAMAccountName"); - info->all.attributes = SE_GROUP_MANDATORY | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_ENABLED; /* Do like w2k3 */ + info->all.attributes = SE_GROUP_DEFAULT_FLAGS; /* Do like w2k3 */ QUERY_UINT (msg, all.num_members, "numMembers") QUERY_STRING(msg, all.description, "description"); break; @@ -2364,14 +2364,14 @@ static NTSTATUS dcesrv_samr_QueryGroupInfo(struct dcesrv_call_state *dce_call, T QUERY_STRING(msg, name, "sAMAccountName"); break; case GROUPINFOATTRIBUTES: - info->attributes.attributes = SE_GROUP_MANDATORY | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_ENABLED; /* Do like w2k3 */ + info->attributes.attributes = SE_GROUP_DEFAULT_FLAGS; /* Do like w2k3 */ break; case GROUPINFODESCRIPTION: QUERY_STRING(msg, description, "description"); break; case GROUPINFOALL2: QUERY_STRING(msg, all2.name, "sAMAccountName"); - info->all.attributes = SE_GROUP_MANDATORY | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_ENABLED; /* Do like w2k3 */ + info->all.attributes = SE_GROUP_DEFAULT_FLAGS; /* Do like w2k3 */ QUERY_UINT (msg, all2.num_members, "numMembers") QUERY_STRING(msg, all2.description, "description"); break; @@ -2676,9 +2676,7 @@ static NTSTATUS dcesrv_samr_QueryGroupMember(struct dcesrv_call_state *dce_call, return status; } - array->attributes[array->count] = SE_GROUP_MANDATORY | - SE_GROUP_ENABLED_BY_DEFAULT | - SE_GROUP_ENABLED; + array->attributes[array->count] = SE_GROUP_DEFAULT_FLAGS; array->count++; } @@ -4437,8 +4435,7 @@ static NTSTATUS dcesrv_samr_GetGroupsForUser(struct dcesrv_call_state *dce_call, /* Adds the primary group */ array->rids[0].rid = primary_group_id; - array->rids[0].attributes = SE_GROUP_MANDATORY - | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_ENABLED; + array->rids[0].attributes = SE_GROUP_DEFAULT_FLAGS; array->count += 1; /* Adds the additional groups */ @@ -4454,8 +4451,7 @@ static NTSTATUS dcesrv_samr_GetGroupsForUser(struct dcesrv_call_state *dce_call, array->rids[i + 1].rid = group_sid->sub_auths[group_sid->num_auths-1]; - array->rids[i + 1].attributes = SE_GROUP_MANDATORY - | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_ENABLED; + array->rids[i + 1].attributes = SE_GROUP_DEFAULT_FLAGS; array->count += 1; } @@ -4740,9 +4736,7 @@ static NTSTATUS dcesrv_samr_QueryDisplayInfo(struct dcesrv_call_state *dce_call, /* * We get a "7" here for groups */ - entriesFullGroup[count].acct_flags = - SE_GROUP_MANDATORY | SE_GROUP_ENABLED_BY_DEFAULT | - SE_GROUP_ENABLED; + entriesFullGroup[count].acct_flags = SE_GROUP_DEFAULT_FLAGS; entriesFullGroup[count].account_name.string = ldb_msg_find_attr_as_string( rec->msgs[0], "sAMAccountName", ""); |