summaryrefslogtreecommitdiffstats
path: root/source/smbd/conn.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/smbd/conn.c')
-rw-r--r--source/smbd/conn.c51
1 files changed, 9 insertions, 42 deletions
diff --git a/source/smbd/conn.c b/source/smbd/conn.c
index 22407348e82..822ff5abcd4 100644
--- a/source/smbd/conn.c
+++ b/source/smbd/conn.c
@@ -1,8 +1,8 @@
/*
- Unix SMB/CIFS implementation.
+ Unix SMB/Netbios implementation.
+ Version 1.9.
Manage connections_struct structures
Copyright (C) Andrew Tridgell 1998
- Copyright (C) Alexander Bokovoy 2002
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -131,7 +131,7 @@ void conn_close_all(void)
connection_struct *conn, *next;
for (conn=Connections;conn;conn=next) {
next=conn->next;
- close_cnum(conn, conn->vuid);
+ close_cnum(conn, (uint16)-1);
}
}
@@ -158,60 +158,27 @@ BOOL conn_idle_all(time_t t, int deadtime)
}
/****************************************************************************
-clear a vuid out of the validity cache, and as the 'owner' of a connection.
-****************************************************************************/
-void conn_clear_vuid_cache(uint16 vuid)
-{
- connection_struct *conn;
- int i;
-
- for (conn=Connections;conn;conn=conn->next) {
- if (conn->vuid == vuid) {
- conn->vuid = UID_FIELD_INVALID;
- }
-
- for (i=0;i<conn->vuid_cache.entries && i< VUID_CACHE_SIZE;i++) {
- if (conn->vuid_cache.list[i] == vuid) {
- conn->vuid_cache.list[i] = UID_FIELD_INVALID;
- }
- }
- }
-}
-
-/****************************************************************************
Free a conn structure.
****************************************************************************/
void conn_free(connection_struct *conn)
{
- smb_vfs_handle_struct *handle, *thandle;
- void (*done_fptr)(connection_struct *the_conn);
-
/* Free vfs_connection_struct */
- handle = conn->vfs_private;
- while(handle) {
- /* Close dlopen() handle */
- done_fptr = (void (*)(connection_struct *))sys_dlsym(handle->handle, "vfs_done");
-
- if (done_fptr == NULL) {
- DEBUG(3, ("No vfs_done() symbol found in module with handle %p, ignoring\n", handle->handle));
- } else {
- done_fptr(conn);
- }
- sys_dlclose(handle->handle);
- DLIST_REMOVE(conn->vfs_private, handle);
- thandle = handle->next;
- SAFE_FREE(handle);
- handle = thandle;
+
+ if (conn->dl_handle != NULL) {
+ /* Close dlopen() handle */
+ sys_dlclose(conn->dl_handle);
}
DLIST_REMOVE(Connections, conn);
if (conn->ngroups && conn->groups) {
SAFE_FREE(conn->groups);
+ conn->groups = NULL;
conn->ngroups = 0;
}
+ delete_nt_token(&conn->nt_user_token);
free_namearray(conn->veto_list);
free_namearray(conn->hide_list);
free_namearray(conn->veto_oplock_list);