From e2e17b7a75e65b2db2eb484f24ecde4f7aa5566b Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 18 Mar 2009 11:55:41 -0400 Subject: Fix getgrent and getpwent calls When I converted from using just the domain name to passing down the info structure I goofed how to test if we were willing to attach the local domain to the user/group names or not. --- server/responder/nss/nsssrv_cmd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'server/responder/nss') diff --git a/server/responder/nss/nsssrv_cmd.c b/server/responder/nss/nsssrv_cmd.c index ef9dd31d..ebd4adae 100644 --- a/server/responder/nss/nsssrv_cmd.c +++ b/server/responder/nss/nsssrv_cmd.c @@ -859,7 +859,9 @@ static void nss_cmd_setpwent_callback(void *ptr, int status, pctx->doms = talloc_realloc(pctx, pctx->doms, struct dom_ctx, pctx->num +1); if (!pctx->doms) NSS_CMD_FATAL_ERROR(cctx); - pctx->doms[pctx->num].domain = dctx->domain->name; + if (dctx->add_domain) { + pctx->doms[pctx->num].domain = dctx->domain->name; + } pctx->doms[pctx->num].res = talloc_steal(pctx->doms, res); pctx->doms[pctx->num].cur = 0; @@ -1897,7 +1899,9 @@ static void nss_cmd_setgrent_callback(void *ptr, int status, gctx->doms = talloc_realloc(gctx, gctx->doms, struct dom_ctx, gctx->num +1); if (!gctx->doms) NSS_CMD_FATAL_ERROR(cctx); - gctx->doms[gctx->num].domain = dctx->domain->name; + if (dctx->add_domain) { + gctx->doms[gctx->num].domain = dctx->domain->name; + } gctx->doms[gctx->num].res = talloc_steal(gctx->doms, res); gctx->doms[gctx->num].cur = 0; -- cgit