summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-01-08 21:19:18 +0000
committerJeremy Allison <jra@samba.org>2001-01-08 21:19:18 +0000
commit7dbc473fa0b91e3620a7b1d91ab478902573c72e (patch)
tree54241698d8736515bcf9ec262ac7150a1268f7d1
parent3a50ad16c5b51d0d812e50cfb65ff43a5786d131 (diff)
downloadsamba-7dbc473fa0b91e3620a7b1d91ab478902573c72e.tar.gz
samba-7dbc473fa0b91e3620a7b1d91ab478902573c72e.tar.xz
samba-7dbc473fa0b91e3620a7b1d91ab478902573c72e.zip
Patch from Richard Bollinger for dead entries being left in connections tdb.
Jeremy.
-rw-r--r--source/smbd/connection.c2
-rw-r--r--source/smbd/server.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/source/smbd/connection.c b/source/smbd/connection.c
index d150508cefb..b0b4bbab7b7 100644
--- a/source/smbd/connection.c
+++ b/source/smbd/connection.c
@@ -55,7 +55,7 @@ BOOL yield_connection(connection_struct *conn,char *name,int max_connections)
ZERO_STRUCT(key);
key.pid = sys_getpid();
- if (conn) key.cnum = conn->cnum;
+ key.cnum = conn?conn->cnum:-1;
fstrcpy(key.name, name);
kbuf.dptr = (char *)&key;
diff --git a/source/smbd/server.c b/source/smbd/server.c
index 69a69948f0d..1fb7d2f4114 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -426,6 +426,11 @@ void exit_server(char *reason)
conn_close_all();
+ /* delete our entry in the connections database. */
+ if (lp_status(-1)) {
+ yield_connection(NULL,"",MAXSTATUS);
+ }
+
respond_to_all_remaining_local_messages();
#ifdef WITH_DFS