diff options
author | Matthew Newton <matthew-git@newtoncomputing.co.uk> | 2015-01-24 00:30:00 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2015-03-10 00:50:10 +0100 |
commit | 348f93ff6e25c43e0233432bd2134bb9eacb0b87 (patch) | |
tree | fe42e733d7a9507a360c6b017369faa2e4f16872 /nsswitch | |
parent | bc75e723ce063149278c95327ef91959718d27be (diff) | |
download | samba-348f93ff6e25c43e0233432bd2134bb9eacb0b87.tar.gz |
Add wbcContext to wbcRequestResponse
To enable libwbclient to pass winbindd context through
to the winbind client library in wb_common.
Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'nsswitch')
-rw-r--r-- | nsswitch/libwbclient/wbclient.c | 24 | ||||
-rw-r--r-- | nsswitch/libwbclient/wbclient_internal.h | 4 |
2 files changed, 21 insertions, 7 deletions
diff --git a/nsswitch/libwbclient/wbclient.c b/nsswitch/libwbclient/wbclient.c index e6b3e4e9e17..ab1159ad937 100644 --- a/nsswitch/libwbclient/wbclient.c +++ b/nsswitch/libwbclient/wbclient.c @@ -56,6 +56,7 @@ void winbindd_ctx_free(struct winbindd_context *ctx); */ static wbcErr wbcRequestResponseInt( + struct winbindd_context *wbctx, int cmd, struct winbindd_request *request, struct winbindd_response *response, @@ -68,7 +69,7 @@ static wbcErr wbcRequestResponseInt( /* for some calls the request and/or response can be NULL */ - nss_status = fn(NULL, cmd, request, response); + nss_status = fn(wbctx, cmd, request, response); switch (nss_status) { case NSS_STATUS_SUCCESS: @@ -91,25 +92,38 @@ static wbcErr wbcRequestResponseInt( /** * @brief Wrapper around Winbind's send/receive API call * + * @param ctx Context * @param cmd Winbind command operation to perform * @param request Send structure * @param response Receive structure * * @return #wbcErr */ -wbcErr wbcRequestResponse(int cmd, +wbcErr wbcRequestResponse(struct wbcContext *ctx, int cmd, struct winbindd_request *request, struct winbindd_response *response) { - return wbcRequestResponseInt(cmd, request, response, + struct winbindd_context *wbctx = NULL; + + if (ctx) { + wbctx = ctx->winbindd_ctx; + } + + return wbcRequestResponseInt(wbctx, cmd, request, response, winbindd_request_response); } -wbcErr wbcRequestResponsePriv(int cmd, +wbcErr wbcRequestResponsePriv(struct wbcContext *ctx, int cmd, struct winbindd_request *request, struct winbindd_response *response) { - return wbcRequestResponseInt(cmd, request, response, + struct winbindd_context *wbctx = NULL; + + if (ctx) { + wbctx = ctx->winbindd_ctx; + } + + return wbcRequestResponseInt(wbctx, cmd, request, response, winbindd_priv_request_response); } diff --git a/nsswitch/libwbclient/wbclient_internal.h b/nsswitch/libwbclient/wbclient_internal.h index e55bf27c0d7..becddacdf82 100644 --- a/nsswitch/libwbclient/wbclient_internal.h +++ b/nsswitch/libwbclient/wbclient_internal.h @@ -28,11 +28,11 @@ struct wbcContext { /* Private functions */ -wbcErr wbcRequestResponse(int cmd, +wbcErr wbcRequestResponse(struct wbcContext *ctx, int cmd, struct winbindd_request *request, struct winbindd_response *response); -wbcErr wbcRequestResponsePriv(int cmd, +wbcErr wbcRequestResponsePriv(struct wbcContext *ctx, int cmd, struct winbindd_request *request, struct winbindd_response *response); |