summaryrefslogtreecommitdiff
path: root/source3/lib/conn_tdb.c
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2012-06-07 13:25:17 +0200
committerMichael Adam <obnox@samba.org>2012-06-27 08:18:18 +0200
commit088e505e84c18709a30301aa410792f5a434c27d (patch)
tree4a7a17671d7c17a63f50665d882f5689ad98db72 /source3/lib/conn_tdb.c
parentc71062fcf4ca192e94ecd32268f79e2bef19428a (diff)
downloadsamba-088e505e84c18709a30301aa410792f5a434c27d.tar.gz
samba-088e505e84c18709a30301aa410792f5a434c27d.tar.bz2
samba-088e505e84c18709a30301aa410792f5a434c27d.zip
s3:conn_tdb: add a function connections_fetch_entry_ext() that also takes the cnum
and have connections_fetch_entry() call connections_fetch_entry_ext(). Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/lib/conn_tdb.c')
-rw-r--r--source3/lib/conn_tdb.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/source3/lib/conn_tdb.c b/source3/lib/conn_tdb.c
index 776f53ca79..fb605e12ba 100644
--- a/source3/lib/conn_tdb.c
+++ b/source3/lib/conn_tdb.c
@@ -54,16 +54,17 @@ static struct db_record *connections_fetch_record(TALLOC_CTX *mem_ctx,
return dbwrap_fetch_locked(ctx, mem_ctx, key);
}
-struct db_record *connections_fetch_entry(TALLOC_CTX *mem_ctx,
- connection_struct *conn,
- const char *name)
+struct db_record *connections_fetch_entry_ext(TALLOC_CTX *mem_ctx,
+ struct server_id id,
+ int cnum,
+ const char *name)
{
struct connections_key ckey;
TDB_DATA key;
ZERO_STRUCT(ckey);
- ckey.pid = messaging_server_id(conn->sconn->msg_ctx);
- ckey.cnum = conn->cnum;
+ ckey.pid = id;
+ ckey.cnum = cnum;
strlcpy(ckey.name, name, sizeof(ckey.name));
key.dsize = sizeof(ckey);
@@ -72,6 +73,15 @@ struct db_record *connections_fetch_entry(TALLOC_CTX *mem_ctx,
return connections_fetch_record(mem_ctx, key);
}
+struct db_record *connections_fetch_entry(TALLOC_CTX *mem_ctx,
+ connection_struct *conn,
+ const char *name)
+{
+ struct server_id id = messaging_server_id(conn->sconn->msg_ctx);
+ return connections_fetch_entry_ext(mem_ctx, id, conn->cnum, name);
+}
+
+
struct conn_traverse_state {
int (*fn)(struct db_record *rec,
const struct connections_key *key,