*/
static wbcErr wbcRequestResponseInt(
+ struct winbindd_context *wbctx,
int cmd,
struct winbindd_request *request,
struct winbindd_response *response,
/* 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:
/**
* @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);
}
/* 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);