struct tevent_queue *queue;
int fd;
bool is_priv;
+ const char *dir;
};
static int make_nonstd_fd(int fd)
return -1;
}
-struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx)
+/* Just put a prototype to avoid moving the whole function around */
+static const char *winbindd_socket_dir(void);
+
+struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx, const char* dir)
{
struct wb_context *result;
}
result->fd = -1;
result->is_priv = false;
+
+ if (dir != NULL) {
+ result->dir = dir;
+ } else {
+ result->dir = winbindd_socket_dir();
+ }
return result;
}
wb_ctx->fd = -1;
}
- subreq = wb_connect_send(state, ev, wb_ctx, winbindd_socket_dir());
+ subreq = wb_connect_send(state, ev, wb_ctx, wb_ctx->dir);
if (subreq == NULL) {
goto fail;
}
struct winbindd_request *wb_req);
wbcErr wb_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
struct winbindd_response **presponse);
-struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx);
+struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx, const char* dir);
/* Definitions from wb_reqtrans.c */
wbcErr map_wbc_err_from_errno(int error);
d_printf("nprocs=%d, numops=%d\n", (int)nprocs, (int)torture_numops);
for (i=0; i<nprocs; i++) {
- wb_ctx[i] = wb_context_init(ev);
+ wb_ctx[i] = wb_context_init(ev, NULL);
if (wb_ctx[i] == NULL) {
goto fail;
}