mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
smbd: Simplify an if-condition
current_sid == NULL is true if and only if we could not assign current_sid because num_sids was too small. Make that more explicit. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
51c950c162
commit
811c184bbb
@ -529,17 +529,11 @@ NTSTATUS smbXsrv_open_create(struct smbXsrv_connection *conn,
|
||||
}
|
||||
current_token = session_info->security_token;
|
||||
|
||||
if (current_token == NULL) {
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
if (current_token->num_sids > PRIMARY_USER_SID_INDEX) {
|
||||
current_sid = ¤t_token->sids[PRIMARY_USER_SID_INDEX];
|
||||
}
|
||||
|
||||
if (current_sid == NULL) {
|
||||
if ((current_token == NULL) ||
|
||||
(current_token->num_sids <= PRIMARY_USER_SID_INDEX)) {
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
}
|
||||
current_sid = ¤t_token->sids[PRIMARY_USER_SID_INDEX];
|
||||
|
||||
if (table->local.num_opens >= table->local.max_opens) {
|
||||
return NT_STATUS_INSUFFICIENT_RESOURCES;
|
||||
|
Loading…
Reference in New Issue
Block a user