From 04a9b0a7b23c2256b782bfc5800cf81f7c73c953 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 16 Sep 2014 07:50:41 +0200 Subject: [PATCH] s3:smb2_glue: remove chained fsps from all connections in remove_smb2_chained_fsp() Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam --- source3/smbd/smb2_glue.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/source3/smbd/smb2_glue.c b/source3/smbd/smb2_glue.c index 1d1fd897f55..b41775d882b 100644 --- a/source3/smbd/smb2_glue.c +++ b/source3/smbd/smb2_glue.c @@ -78,15 +78,22 @@ size_t smbd_smb2_unread_bytes(struct smbd_smb2_request *req) void remove_smb2_chained_fsp(files_struct *fsp) { struct smbd_server_connection *sconn = fsp->conn->sconn; - struct smbXsrv_connection *xconn = sconn->conn; - struct smbd_smb2_request *smb2req; + struct smbXsrv_connection *xconn = NULL; - for (smb2req = xconn->smb2.requests; smb2req; smb2req = smb2req->next) { - if (smb2req->compat_chain_fsp == fsp) { - smb2req->compat_chain_fsp = NULL; - } - if (smb2req->smb1req && smb2req->smb1req->chain_fsp == fsp) { - smb2req->smb1req->chain_fsp = NULL; + if (sconn->client != NULL) { + xconn = sconn->client->connections; + } + + for (; xconn != NULL; xconn = xconn->next) { + struct smbd_smb2_request *smb2req; + + for (smb2req = xconn->smb2.requests; smb2req; smb2req = smb2req->next) { + if (smb2req->compat_chain_fsp == fsp) { + smb2req->compat_chain_fsp = NULL; + } + if (smb2req->smb1req && smb2req->smb1req->chain_fsp == fsp) { + smb2req->smb1req->chain_fsp = NULL; + } } } } -- 2.11.4.GIT