diff options
-rw-r--r-- | nsswitch/libwbclient/wbc_async.c | 14 | ||||
-rw-r--r-- | nsswitch/libwbclient/wbc_async.h | 2 | ||||
-rw-r--r-- | source3/torture/torture.c | 2 |
3 files changed, 14 insertions, 4 deletions
diff --git a/nsswitch/libwbclient/wbc_async.c b/nsswitch/libwbclient/wbc_async.c index 141c9816aa..6a572f4203 100644 --- a/nsswitch/libwbclient/wbc_async.c +++ b/nsswitch/libwbclient/wbc_async.c @@ -88,6 +88,7 @@ struct wb_context { struct tevent_queue *queue; int fd; bool is_priv; + const char *dir; }; static int make_nonstd_fd(int fd) @@ -179,7 +180,10 @@ static int make_safe_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; @@ -194,6 +198,12 @@ struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx) } result->fd = -1; result->is_priv = false; + + if (dir != NULL) { + result->dir = dir; + } else { + result->dir = winbindd_socket_dir(); + } return result; } @@ -351,7 +361,7 @@ static struct tevent_req *wb_open_pipe_send(TALLOC_CTX *mem_ctx, 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; } diff --git a/nsswitch/libwbclient/wbc_async.h b/nsswitch/libwbclient/wbc_async.h index a2e0eed448..607dd9de28 100644 --- a/nsswitch/libwbclient/wbc_async.h +++ b/nsswitch/libwbclient/wbc_async.h @@ -38,7 +38,7 @@ struct tevent_req *wb_trans_send(TALLOC_CTX *mem_ctx, 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); diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 30e7e8cbc5..d185a71727 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -5985,7 +5985,7 @@ static bool run_local_wbclient(int dummy) 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; } |