diff options
author | Ralph Boehme <slow@samba.org> | 2020-01-01 15:20:05 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2020-01-13 19:41:35 +0000 |
commit | 25524c8e78b0a927bcea5851d7282af0f0a0654e (patch) | |
tree | 8604ffd55a8a2d1188c1d662368f6855003e6290 | |
parent | c3f890fb1e982603c7f24033fc1e5d73535fbbb8 (diff) | |
download | samba-25524c8e78b0a927bcea5851d7282af0f0a0654e.tar.gz |
smbd: use smbXsrv_session_info_lookup() in api_reply()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | source3/smbd/lanman.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c index c62258fda65..abbec164217 100644 --- a/source3/smbd/lanman.c +++ b/source3/smbd/lanman.c @@ -5792,9 +5792,18 @@ void api_reply(connection_struct *conn, uint64_t vuid, /* Check whether this api call can be done anonymously */ if (api_commands[i].auth_user && lp_restrict_anonymous()) { - struct user_struct *user = get_valid_user_struct(req->sconn, vuid); + struct auth_session_info *si = NULL; + NTSTATUS status; - if (!user || security_session_user_level(user->session_info, NULL) < SECURITY_USER) { + status = smbXsrv_session_info_lookup(conn->sconn->client, + vuid, + &si); + if (!NT_STATUS_IS_OK(status)) { + reply_nterror(req, NT_STATUS_ACCESS_DENIED); + return; + } + + if (security_session_user_level(si, NULL) < SECURITY_USER) { reply_nterror(req, NT_STATUS_ACCESS_DENIED); return; } |