}
/****************************************************************************
- Free a conn structure.
+ Free a conn structure - internal part.
****************************************************************************/
-void conn_free(connection_struct *conn)
+void conn_free_internal(connection_struct *conn)
{
vfs_handle_struct *handle = NULL, *thandle = NULL;
TALLOC_CTX *mem_ctx = NULL;
handle = thandle;
}
- DLIST_REMOVE(Connections, conn);
-
if (conn->ngroups && conn->groups) {
SAFE_FREE(conn->groups);
conn->ngroups = 0;
}
+ if (conn->nt_user_token) {
+ TALLOC_FREE(conn->nt_user_token);
+ }
+
free_namearray(conn->veto_list);
free_namearray(conn->hide_list);
free_namearray(conn->veto_oplock_list);
+ free_namearray(conn->aio_write_behind_list);
string_free(&conn->user);
string_free(&conn->dirpath);
string_free(&conn->connectpath);
string_free(&conn->origpath);
- bitmap_clear(bmap, conn->cnum);
- num_open--;
-
mem_ctx = conn->mem_ctx;
ZERO_STRUCTP(conn);
talloc_destroy(mem_ctx);
}
+/****************************************************************************
+ Free a conn structure.
+****************************************************************************/
+
+void conn_free(connection_struct *conn)
+{
+ DLIST_REMOVE(Connections, conn);
+
+ bitmap_clear(bmap, conn->cnum);
+ num_open--;
+ conn_free_internal(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)
+void msg_force_tdis(int msg_type, struct process_id pid, void *buf, size_t len)
{
connection_struct *conn, *next;
fstring sharename;
- fstrcpy(sharename, buf);
+ fstrcpy(sharename, (const char *)buf);
if (strcmp(sharename, "*") == 0) {
DEBUG(1,("Forcing close of all shares\n"));