]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Add smbXsrv_client_valid_connections().
authorJeremy Allison <jra@samba.org>
Thu, 25 Jun 2020 21:56:03 +0000 (14:56 -0700)
committerKarolin Seeger <kseeger@samba.org>
Fri, 26 Jun 2020 07:52:26 +0000 (07:52 +0000)
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>
source3/smbd/globals.h
source3/smbd/smb2_server.c

index 7b26d04ed0f192d85e7c6112bec84a9b6741606f..5bcf0503b4c7370c71f63222bd0b622111f0a739 100644 (file)
@@ -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);
index 88937ac19b0971e16b3981929e8f3e6757d3a706..f0fe14624cd6fe1758240516cc122db21fc11d20 100644 (file)
@@ -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)