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.
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)