diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2022-12-16 12:08:41 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2023-02-08 00:03:39 +0000 |
commit | e20067c52d642123b7ed929c1e35a2c0d144b13c (patch) | |
tree | 7b0c97ed0ada07c40e068194fa9fb51217ffd241 /librpc | |
parent | 5147f011d9b2b37dd46939d4b50d71d50a6776c1 (diff) | |
download | samba-e20067c52d642123b7ed929c1e35a2c0d144b13c.tar.gz |
auth: Make more liberal use of SID index constants
Arrays of SIDs are handled not fully consistently throughout the
codebase. Sometimes SIDs in the first and second positions represent a
user and a primary group respectively; other times they don't mean
anything in particular. Using these index constants in situations of the
former sort can help to clarify our intent.
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'librpc')
-rw-r--r-- | librpc/rpc/dcesrv_handles.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/librpc/rpc/dcesrv_handles.c b/librpc/rpc/dcesrv_handles.c index da1f00f5b67..b8719d8c804 100644 --- a/librpc/rpc/dcesrv_handles.c +++ b/librpc/rpc/dcesrv_handles.c @@ -277,7 +277,7 @@ NTSTATUS _dcesrv_iface_state_store_assoc(struct dcesrv_call_state *call, struct auth_session_info *session_info = dcesrv_call_session_info(call); const struct dom_sid *owner = - &session_info->security_token->sids[0]; + &session_info->security_token->sids[PRIMARY_USER_SID_INDEX]; NTSTATUS status; status = dcesrv_iface_state_store(call->conn->assoc_group, @@ -302,7 +302,7 @@ void *_dcesrv_iface_state_find_assoc(struct dcesrv_call_state *call, uint64_t ma struct auth_session_info *session_info = dcesrv_call_session_info(call); const struct dom_sid *owner = - &session_info->security_token->sids[0]; + &session_info->security_token->sids[PRIMARY_USER_SID_INDEX]; void *ptr = NULL; ptr = dcesrv_iface_state_find(call->conn->assoc_group, @@ -328,7 +328,7 @@ NTSTATUS _dcesrv_iface_state_store_conn(struct dcesrv_call_state *call, struct auth_session_info *session_info = dcesrv_call_session_info(call); const struct dom_sid *owner = - &session_info->security_token->sids[0]; + &session_info->security_token->sids[PRIMARY_USER_SID_INDEX]; NTSTATUS status; status = dcesrv_iface_state_store(call->conn->assoc_group, @@ -353,7 +353,7 @@ void *_dcesrv_iface_state_find_conn(struct dcesrv_call_state *call, uint64_t mag struct auth_session_info *session_info = dcesrv_call_session_info(call); const struct dom_sid *owner = - &session_info->security_token->sids[0]; + &session_info->security_token->sids[PRIMARY_USER_SID_INDEX]; void *ptr = NULL; ptr = dcesrv_iface_state_find(call->conn->assoc_group, |