summaryrefslogtreecommitdiffstats
path: root/source/smbd/conn.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-06-20 03:05:09 +0000
committerAndrew Tridgell <tridge@samba.org>2001-06-20 03:05:09 +0000
commit15b17a80db605a55f667c95fb7e316877a441887 (patch)
treee4aa33d144d827fabe393b58adf108afe75c677d /source/smbd/conn.c
parent8e982941d82b813197f2a9720149e60f629b5b20 (diff)
downloadsamba-15b17a80db605a55f667c95fb7e316877a441887.tar.gz
samba-15b17a80db605a55f667c95fb7e316877a441887.tar.xz
samba-15b17a80db605a55f667c95fb7e316877a441887.zip
added a close-share smbcontrol message that forcibly closes a share in smbd (to allow unmount)
Diffstat (limited to 'source/smbd/conn.c')
-rw-r--r--source/smbd/conn.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/source/smbd/conn.c b/source/smbd/conn.c
index e9f79fdf32b..c2faa4f15a5 100644
--- a/source/smbd/conn.c
+++ b/source/smbd/conn.c
@@ -198,3 +198,33 @@ void conn_free(connection_struct *conn)
ZERO_STRUCTP(conn);
free(conn);
}
+
+
+/****************************************************************************
+receive a smbcontrol message to forcibly unmount a share
+the message contains just a share name and all instances of that
+share are unmounted
+the special sharename '*' forces unmount of all shares
+****************************************************************************/
+void msg_force_tdis(int msg_type, pid_t pid, void *buf, size_t len)
+{
+ connection_struct *conn, *next;
+ fstring sharename;
+
+ fstrcpy(sharename, buf);
+
+ if (strcmp(sharename, "*") == 0) {
+ DEBUG(1,("Forcing close of all shares\n"));
+ conn_close_all();
+ return;
+ }
+
+ for (conn=Connections;conn;conn=next) {
+ next=conn->next;
+ if (strequal(lp_servicename(conn->service), sharename)) {
+ DEBUG(1,("Forcing close of share %s cnum=%d\n",
+ sharename, conn->cnum));
+ close_cnum(conn, (uint16)-1);
+ }
+ }
+}