summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/connection.c12
-rw-r--r--source3/smbd/proto.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c
index 5da2b08faa..5a9f4071b4 100644
--- a/source3/smbd/connection.c
+++ b/source3/smbd/connection.c
@@ -130,6 +130,18 @@ int count_current_connections( const char *sharename, bool clear )
return cs.curr_connections;
}
+bool connections_snum_used(struct smbd_server_connection *unused, int snum)
+{
+ int active;
+
+ active = count_current_connections(lp_servicename(snum), true);
+ if (active > 0) {
+ return true;
+ }
+
+ return false;
+}
+
/****************************************************************************
Claim an entry in the connections database.
****************************************************************************/
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index 151ae78ec3..6d833d7b2d 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -164,6 +164,7 @@ void msg_force_tdis(struct messaging_context *msg,
bool yield_connection(connection_struct *conn, const char *name);
int count_current_connections( const char *sharename, bool clear );
+bool connections_snum_used(struct smbd_server_connection *unused, int snum);
bool claim_connection(connection_struct *conn, const char *name);
/* The following definitions come from smbd/dfree.c */