summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-03-22 13:41:16 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-03-22 13:41:16 +0000
commit5050e8ee1a1fd3280d65d22c079ac90cf7e454e9 (patch)
tree94295fe4a0d5c460d9fa832f485f1af1df57bcd6 /source3/smbd
parenta38e5e6850220fc1a0afa5097359c05458e1ae41 (diff)
downloadsamba-5050e8ee1a1fd3280d65d22c079ac90cf7e454e9.tar.gz
samba-5050e8ee1a1fd3280d65d22c079ac90cf7e454e9.tar.bz2
samba-5050e8ee1a1fd3280d65d22c079ac90cf7e454e9.zip
Revert bogus part of previous patch.
(This used to be commit 3cddfe211da812a533611eecba5d5da55fd3cf2d)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/connection.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c
index ff6974cade..5547309a81 100644
--- a/source3/smbd/connection.c
+++ b/source3/smbd/connection.c
@@ -35,12 +35,15 @@ TDB_CONTEXT *conn_tdb_ctx(void)
return tdb;
}
-static void make_conn_key(connection_struct *conn, const char *name, TDB_DATA *pkbuf, fstring tdb_key)
+static void make_conn_key(connection_struct *conn, const char *name, TDB_DATA *pkbuf, struct connections_key *pkey)
{
- snprintf(tdb_key, sizeof(fstring), "CONN/%lu/%ld", sys_getpid(), conn?conn->cnum:-1);
+ ZERO_STRUCTP(pkey);
+ pkey->pid = sys_getpid();
+ pkey->cnum = conn?conn->cnum:-1;
+ fstrcpy(pkey->name, name);
- pkbuf->dptr = tdb_key;
- pkbuf->dsize = strlen(tdb_key)+1;
+ pkbuf->dptr = (char *)pkey;
+ pkbuf->dsize = sizeof(*pkey);
}
/****************************************************************************
@@ -49,7 +52,7 @@ static void make_conn_key(connection_struct *conn, const char *name, TDB_DATA *p
BOOL yield_connection(connection_struct *conn, const char *name)
{
- fstring tdb_key;
+ struct connections_key key;
TDB_DATA kbuf;
if (!tdb)
@@ -57,7 +60,7 @@ BOOL yield_connection(connection_struct *conn, const char *name)
DEBUG(3,("Yielding connection to %s\n",name));
- make_conn_key(conn, name, &kbuf, tdb_key);
+ make_conn_key(conn, name, &kbuf, &key);
if (tdb_delete(tdb, kbuf) != 0) {
int dbg_lvl = (!conn && (tdb_error(tdb) == TDB_ERR_NOEXIST)) ? 3 : 0;