-#define OLD_NTDOMAIN 1
-
/*
- Unix SMB/Netbios implementation.
- Version 1.9.
+ Unix SMB/CIFS implementation.
Manage connections_struct structures
Copyright (C) Andrew Tridgell 1998
#include "includes.h"
-extern int DEBUGLEVEL;
-
/* set these to define the limits of the server. NOTE These are on a
per-client basis. Thus any one machine can't connect to more than
MAX_CONNECTIONS services, but any number of machines may connect at
/* Free vfs_connection_struct */
#ifdef HAVE_LIBDL
- if (conn->vfs_conn != NULL) {
+ if (conn->dl_handle != NULL) {
/* Close dlopen() handle */
- if (conn->vfs_conn->dl_handle) {
- dlclose(conn->vfs_conn->dl_handle);
- }
-#endif /* HAVE_LIBDL */
-
- if (conn->vfs_conn->groups != NULL) {
- free(conn->vfs_conn->groups);
- }
- delete_nt_token(&conn->vfs_conn->nt_user_token);
- free(conn->vfs_conn);
+ dlclose(conn->dl_handle);
}
+#endif /* HAVE_LIBDL */
DLIST_REMOVE(Connections, conn);
if (conn->ngroups && conn->groups) {
- free(conn->groups);
- conn->groups = NULL;
+ SAFE_FREE(conn->groups);
conn->ngroups = 0;
}
num_open--;
ZERO_STRUCTP(conn);
- free(conn);
+ SAFE_FREE(conn);
}
-#undef OLD_NTDOMAIN
+
+/****************************************************************************
+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);
+ }
+ }
+}