diff options
author | Sumit Bose <sbose@redhat.com> | 2014-07-07 11:57:03 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-09-01 13:56:57 +0200 |
commit | 7d2437adc312d3322d36043ff458fafdb4b7f2cf (patch) | |
tree | 773b0060378326899bf9ef101a3ecfc67b21f059 | |
parent | 17c4d901ecf62fa9d641d46c9e92032b0deaaa36 (diff) | |
download | sssd-7d2437adc312d3322d36043ff458fafdb4b7f2cf.tar.gz sssd-7d2437adc312d3322d36043ff458fafdb4b7f2cf.tar.xz sssd-7d2437adc312d3322d36043ff458fafdb4b7f2cf.zip |
NSS: check_cache() add extra option
This patch adds a new parameter to check_cache() to allow to set the
extra value which is send to the backend during lookup requests.
-rw-r--r-- | src/responder/nss/nsssrv_cmd.c | 19 | ||||
-rw-r--r-- | src/responder/nss/nsssrv_netgroup.c | 2 | ||||
-rw-r--r-- | src/responder/nss/nsssrv_private.h | 1 |
3 files changed, 12 insertions, 10 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c index 91139980a..04ff2d654 100644 --- a/src/responder/nss/nsssrv_cmd.c +++ b/src/responder/nss/nsssrv_cmd.c @@ -524,6 +524,7 @@ errno_t check_cache(struct nss_dom_ctx *dctx, int req_type, const char *opt_name, uint32_t opt_id, + const char *extra, sss_dp_callback_t callback, void *pvt) { @@ -582,7 +583,7 @@ errno_t check_cache(struct nss_dom_ctx *dctx, "Performing midpoint cache update on [%s]\n", opt_name); req = sss_dp_get_account_send(cctx, cctx->rctx, dctx->domain, true, - req_type, opt_name, opt_id, NULL); + req_type, opt_name, opt_id, extra); if (!req) { DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory sending out-of-band data provider " @@ -611,7 +612,7 @@ errno_t check_cache(struct nss_dom_ctx *dctx, } req = sss_dp_get_account_send(cctx, cctx->rctx, dctx->domain, true, - req_type, opt_name, opt_id, NULL); + req_type, opt_name, opt_id, extra); if (!req) { DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory sending data provider request\n"); @@ -834,7 +835,7 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx *dctx) * yet) then verify that the cache is uptodate */ if (dctx->check_provider) { ret = check_cache(dctx, nctx, dctx->res, - SSS_DP_USER, name, 0, + SSS_DP_USER, name, 0, NULL, nss_cmd_getby_dp_callback, dctx); if (ret != EOK) { @@ -1409,7 +1410,7 @@ static int nss_cmd_getpwuid_search(struct nss_dom_ctx *dctx) * yet) then verify that the cache is uptodate */ if (dctx->check_provider) { ret = check_cache(dctx, nctx, dctx->res, - SSS_DP_USER, NULL, cmdctx->id, + SSS_DP_USER, NULL, cmdctx->id, NULL, nss_cmd_getby_dp_callback, dctx); if (ret != EOK) { @@ -2810,7 +2811,7 @@ static int nss_cmd_getgrnam_search(struct nss_dom_ctx *dctx) * yet) then verify that the cache is uptodate */ if (dctx->check_provider) { ret = check_cache(dctx, nctx, dctx->res, - SSS_DP_GROUP, name, 0, + SSS_DP_GROUP, name, 0, NULL, nss_cmd_getby_dp_callback, dctx); if (ret != EOK) { @@ -2925,7 +2926,7 @@ static int nss_cmd_getgrgid_search(struct nss_dom_ctx *dctx) * yet) then verify that the cache is uptodate */ if (dctx->check_provider) { ret = check_cache(dctx, nctx, dctx->res, - SSS_DP_GROUP, NULL, cmdctx->id, + SSS_DP_GROUP, NULL, cmdctx->id, NULL, nss_cmd_getby_dp_callback, dctx); if (ret != EOK) { @@ -3827,7 +3828,7 @@ static int nss_cmd_initgroups_search(struct nss_dom_ctx *dctx) * yet) then verify that the cache is uptodate */ if (dctx->check_provider) { ret = check_cache(dctx, nctx, dctx->res, - SSS_DP_INITGROUPS, name, 0, + SSS_DP_INITGROUPS, name, 0, NULL, nss_cmd_getby_dp_callback, dctx); if (ret != EOK) { @@ -4101,7 +4102,7 @@ static errno_t nss_cmd_getsidby_search(struct nss_dom_ctx *dctx) } ret = check_cache(dctx, nctx, dctx->res, - req_type, req_name, req_id, + req_type, req_name, req_id, NULL, nss_cmd_getby_dp_callback, dctx); if (ret != EOK) { @@ -4204,7 +4205,7 @@ static errno_t nss_cmd_getbysid_search(struct nss_dom_ctx *dctx) * yet) then verify that the cache is uptodate */ if (dctx->check_provider) { ret = check_cache(dctx, nctx, dctx->res, - SSS_DP_SECID, cmdctx->secid, 0, + SSS_DP_SECID, cmdctx->secid, 0, NULL, nss_cmd_getby_dp_callback, dctx); if (ret != EOK) { diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c index 5f879e2dd..66b7f2759 100644 --- a/src/responder/nss/nsssrv_netgroup.c +++ b/src/responder/nss/nsssrv_netgroup.c @@ -581,7 +581,7 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) step_ctx->nctx, step_ctx->dctx->res, SSS_DP_NETGR, - name, 0, + name, 0, NULL, lookup_netgr_dp_callback, step_ctx); if (ret != EOK) { diff --git a/src/responder/nss/nsssrv_private.h b/src/responder/nss/nsssrv_private.h index 2dcc07b5c..23bb6a8d3 100644 --- a/src/responder/nss/nsssrv_private.h +++ b/src/responder/nss/nsssrv_private.h @@ -122,6 +122,7 @@ errno_t check_cache(struct nss_dom_ctx *dctx, int req_type, const char *opt_name, uint32_t opt_id, + const char *extra, sss_dp_callback_t callback, void *pvt); |