summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2020-06-25 14:56:03 -0700
committerKarolin Seeger <kseeger@samba.org>2020-06-26 07:52:26 +0000
commit8666dc1eec63b74830b95112bb4c589c5aa788dd (patch)
tree1fcd9acd7814016b5e4bf0d88674e255d22c24ff
parent19c6e21cfd62dcda709fca5ea9fc1bad04533277 (diff)
downloadsamba-8666dc1eec63b74830b95112bb4c589c5aa788dd.tar.gz
s3: smbd: Add smbXsrv_client_valid_connections().
Next commit will make use of this. Followup-bugfix for: BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301 Signed-off-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/smbd/globals.h1
-rw-r--r--source3/smbd/smb2_server.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 7b26d04ed0f..5bcf0503b4c 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -219,6 +219,7 @@ NTSTATUS smbd_calculate_access_mask(connection_struct *conn,
void smbd_notify_cancel_by_smbreq(const struct smb_request *smbreq);
+size_t smbXsrv_client_valid_connections(struct smbXsrv_client *client);
void smbd_server_connection_terminate_ex(struct smbXsrv_connection *xconn,
const char *reason,
const char *location);
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 88937ac19b0..f0fe14624cd 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -1106,6 +1106,20 @@ static NTSTATUS smbd_smb2_request_setup_out(struct smbd_smb2_request *req)
return NT_STATUS_OK;
}
+size_t smbXsrv_client_valid_connections(struct smbXsrv_client *client)
+{
+ struct smbXsrv_connection *xconn = NULL;
+ size_t num_ok = 0;
+
+ for (xconn = client->connections; xconn != NULL; xconn = xconn->next) {
+ if (NT_STATUS_IS_OK(xconn->transport.status)) {
+ num_ok++;
+ }
+ }
+
+ return num_ok;
+}
+
void smbd_server_connection_terminate_ex(struct smbXsrv_connection *xconn,
const char *reason,
const char *location)