summaryrefslogtreecommitdiff
path: root/src/responder
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-04-24 23:52:13 +0200
committerStephen Gallagher <sgallagh@redhat.com>2012-04-24 19:27:39 -0400
commit24ba5b87c9a2c01deddc9be867e4951e2a397146 (patch)
tree3f3e58cb0e1ef0cd0515e81773084b8197ea7588 /src/responder
parent25912ba00b14f06db32b982fd067c3fa0a09e99f (diff)
downloadsssd-24ba5b87c9a2c01deddc9be867e4951e2a397146.tar.gz
sssd-24ba5b87c9a2c01deddc9be867e4951e2a397146.tar.bz2
sssd-24ba5b87c9a2c01deddc9be867e4951e2a397146.zip
NSS: Only return data from initgroups once
Do not let nss_cmd_initgroups_search() return data itself, but let the caller return data. This is more intuitive and more consistent with the rest of the nss_cmd_*_search() functions. Also fixes a typo - nss_cmd_initgroups_cb used to call getpw_send_reply instead of initgr_send_reply.
Diffstat (limited to 'src/responder')
-rw-r--r--src/responder/nss/nsssrv_cmd.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index 85d83e32..2c956457 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -3181,8 +3181,7 @@ static int nss_cmd_initgroups_search(struct nss_dom_ctx *dctx)
}
DEBUG(6, ("Initgroups for [%s@%s] completed\n", name, dom->name));
-
- return nss_cmd_initgr_send_reply(dctx);
+ return EOK;
}
DEBUG(SSSDBG_MINOR_FAILURE,
@@ -3222,6 +3221,10 @@ static void nss_cmd_initgroups_dp_callback(uint16_t err_maj, uint32_t err_min,
/* ok the backend returned, search to see if we have updated results */
ret = nss_cmd_initgroups_search(dctx);
+ if (ret == EOK) {
+ /* we have results to return */
+ ret = nss_cmd_initgr_send_reply(dctx);
+ }
done:
ret = nss_cmd_done(cmdctx, ret);
@@ -3318,6 +3321,10 @@ static int nss_cmd_initgroups(struct cli_ctx *cctx)
/* ok, find it ! */
ret = nss_cmd_initgroups_search(dctx);
+ if (ret == EOK) {
+ /* we have results to return */
+ ret = nss_cmd_initgr_send_reply(dctx);
+ }
done:
return nss_cmd_done(cmdctx, ret);
@@ -3350,7 +3357,7 @@ static void nss_cmd_initgroups_cb(struct tevent_req *req)
ret = nss_cmd_initgroups_search(dctx);
if (ret == EOK) {
/* we have results to return */
- ret = nss_cmd_getpw_send_reply(dctx, false);
+ ret = nss_cmd_initgr_send_reply(dctx);
}
done: