summaryrefslogtreecommitdiff
path: root/server/responder/nss/nsssrv_cmd.c
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-09-11 16:11:23 -0400
committerSimo Sorce <ssorce@redhat.com>2009-09-11 17:16:06 -0400
commitb187d74a6d6e4e0c1102b510f7fc8340d41ae30a (patch)
tree7cfb3a6a7225bd862f612e4388d9f71f72d37a85 /server/responder/nss/nsssrv_cmd.c
parentbd93bb09eb3c58add1bae0cf67eda60fdd80787d (diff)
downloadsssd-b187d74a6d6e4e0c1102b510f7fc8340d41ae30a.tar.gz
sssd-b187d74a6d6e4e0c1102b510f7fc8340d41ae30a.tar.bz2
sssd-b187d74a6d6e4e0c1102b510f7fc8340d41ae30a.zip
Fix getgrnam and getgrgid calls
The patch that added check_cache() broke them, no results returned for any group with actual members ...
Diffstat (limited to 'server/responder/nss/nsssrv_cmd.c')
-rw-r--r--server/responder/nss/nsssrv_cmd.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/server/responder/nss/nsssrv_cmd.c b/server/responder/nss/nsssrv_cmd.c
index 92600933..8ca0be68 100644
--- a/server/responder/nss/nsssrv_cmd.c
+++ b/server/responder/nss/nsssrv_cmd.c
@@ -287,16 +287,16 @@ static errno_t check_cache(struct nss_dom_ctx *dctx,
sss_dp_callback_t cb = NULL;
if (dctx->check_provider) {
- switch (res->count) {
- case 0:
+ if (res->count == 0) {
/* This is a cache miss. We need to get the updated user
* information before returning it.
*/
call_provider = true;
cb = callback;
- break;
- case 1:
+ } else if ((req_type == SSS_DP_GROUP) ||
+ ((req_type == SSS_DP_USER) && (res->count == 1))) {
+
timeout = nctx->cache_timeout;
refresh_timeout = nctx->cache_refresh_timeout;
now = time(NULL);
@@ -323,10 +323,12 @@ static errno_t check_cache(struct nss_dom_ctx *dctx,
call_provider = false;
cb = NULL;
}
- break;
- default:
- DEBUG(1, ("getpwnam call returned more than one result !?!\n"));
+ } else {
+ if (req_type == SSS_DP_USER) {
+ DEBUG(1, ("getpwXXX call returned more than one result!"
+ " DB Corrupted?\n"));
+ }
ret = nss_cmd_send_error(cmdctx, ENOENT);
if (ret != EOK) {
NSS_CMD_FATAL_ERROR_CODE(cctx, ENOENT);