summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-03-01 13:57:36 +0100
committerVolker Lendecke <vl@samba.org>2010-03-01 14:02:35 +0100
commitc571ecdfc4eae8aa4bfffefacb9eb9306cbc6389 (patch)
tree933fae18aa934cf748097c499201276881c8c78f
parentf79ff9582f3c5e1c1d756ef3b3dc0379fdb9912d (diff)
downloadsamba-c571ecdfc4eae8aa4bfffefacb9eb9306cbc6389.tar.gz
samba-c571ecdfc4eae8aa4bfffefacb9eb9306cbc6389.tar.bz2
samba-c571ecdfc4eae8aa4bfffefacb9eb9306cbc6389.zip
s3: Make connections_forall open connections.tdb r/w
connections_forall is called from count_current_connections() which potentially deletes dead records. This needs r/w access to connections.tdb. connections_traverse says it does not provide this. Does not really matter in the smbd case, because we have opened it before r/w, so this is "just" cleanup.
-rw-r--r--source3/lib/conn_tdb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/lib/conn_tdb.c b/source3/lib/conn_tdb.c
index a10734bed5..90e455a73e 100644
--- a/source3/lib/conn_tdb.c
+++ b/source3/lib/conn_tdb.c
@@ -112,12 +112,18 @@ int connections_forall(int (*fn)(struct db_record *rec,
void *private_data),
void *private_data)
{
+ struct db_context *ctx;
struct conn_traverse_state state;
+ ctx = connections_db_ctx(true);
+ if (ctx == NULL) {
+ return -1;
+ }
+
state.fn = fn;
state.private_data = private_data;
- return connections_traverse(conn_traverse_fn, (void *)&state);
+ return ctx->traverse(ctx, conn_traverse_fn, (void *)&state);
}
bool connections_init(bool rw)