From: Ralph Boehme Date: Thu, 2 Jan 2020 15:26:03 +0000 (+0100) Subject: smbd: remove use of user_struct from reply_ulogoffX() X-Git-Tag: ldb-2.1.0~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8be0ca8e19b861d13038769289325537c101072b;p=thirdparty%2Fsamba.git smbd: remove use of user_struct from reply_ulogoffX() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 3c0c7dbb631..40cd7483750 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -2613,16 +2613,17 @@ void reply_open_and_X(struct smb_request *req) void reply_ulogoffX(struct smb_request *req) { - struct smbd_server_connection *sconn = req->sconn; - struct user_struct *vuser; + struct timeval now = timeval_current(); struct smbXsrv_session *session = NULL; NTSTATUS status; START_PROFILE(SMBulogoffX); - vuser = get_valid_user_struct(sconn, req->vuid); - - if(vuser == NULL) { + status = smb1srv_session_lookup(req->xconn, + req->vuid, + timeval_to_nttime(&now), + &session); + if (!NT_STATUS_IS_OK(status)) { DEBUG(3,("ulogoff, vuser id %llu does not map to user.\n", (unsigned long long)req->vuid)); @@ -2632,9 +2633,6 @@ void reply_ulogoffX(struct smb_request *req) return; } - session = vuser->session; - vuser = NULL; - /* * TODO: cancel all outstanding requests on the session */