diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-12-05 16:00:44 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-12-16 14:46:16 -0500 |
commit | 247a7056af42fc50bbc896cddb66a60154ca12e9 (patch) | |
tree | bd19e4874f9ebd1f441f414851ba71aa72f550c5 /src/responder/nss | |
parent | dbea04f585a30d001b574317c068cd03a4fa332b (diff) | |
download | sssd-247a7056af42fc50bbc896cddb66a60154ca12e9.tar.gz sssd-247a7056af42fc50bbc896cddb66a60154ca12e9.tar.bz2 sssd-247a7056af42fc50bbc896cddb66a60154ca12e9.zip |
Responders: Split getting domain by name into separate function
Diffstat (limited to 'src/responder/nss')
-rw-r--r-- | src/responder/nss/nsssrv_cmd.c | 19 | ||||
-rw-r--r-- | src/responder/nss/nsssrv_netgroup.c | 2 |
2 files changed, 4 insertions, 17 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c index 720813fd..f0270acd 100644 --- a/src/responder/nss/nsssrv_cmd.c +++ b/src/responder/nss/nsssrv_cmd.c @@ -45,19 +45,6 @@ static int nss_cmd_send_error(struct nss_cmd_ctx *cmdctx, int err) return EOK; } -struct sss_domain_info *nss_get_dom(struct sss_domain_info *doms, - const char *domain) -{ - struct sss_domain_info *dom; - - for (dom = doms; dom; dom = dom->next) { - if (strcasecmp(dom->name, domain) == 0) break; - } - if (!dom) DEBUG(2, ("Unknown domain [%s]!\n", domain)); - - return dom; -} - int fill_empty(struct sss_packet *packet) { uint8_t *body; @@ -932,7 +919,7 @@ static int nss_cmd_getpwnam(struct cli_ctx *cctx) cmdctx->name, domname?domname:"<ALL>")); if (domname) { - dctx->domain = nss_get_dom(cctx->rctx->domains, domname); + dctx->domain = responder_get_domain(cctx->rctx->domains, domname); if (!dctx->domain) { ret = ENOENT; goto done; @@ -2219,7 +2206,7 @@ static int nss_cmd_getgrnam(struct cli_ctx *cctx) cmdctx->name, domname?domname:"<ALL>")); if (domname) { - dctx->domain = nss_get_dom(cctx->rctx->domains, domname); + dctx->domain = responder_get_domain(cctx->rctx->domains, domname); if (!dctx->domain) { ret = ENOENT; goto done; @@ -3277,7 +3264,7 @@ static int nss_cmd_initgroups(struct cli_ctx *cctx) cmdctx->name, domname?domname:"<ALL>")); if (domname) { - dctx->domain = nss_get_dom(cctx->rctx->domains, domname); + dctx->domain = responder_get_domain(cctx->rctx->domains, domname); if (!dctx->domain) { ret = ENOENT; goto done; diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c index 189f8524..09b7fa63 100644 --- a/src/responder/nss/nsssrv_netgroup.c +++ b/src/responder/nss/nsssrv_netgroup.c @@ -204,7 +204,7 @@ static struct tevent_req *setnetgrent_send(TALLOC_CTX *mem_ctx, state->netgr_shortname, domname?domname:"<ALL>")); if (domname) { - dctx->domain = nss_get_dom(client->rctx->domains, domname); + dctx->domain = responder_get_domain(client->rctx->domains, domname); if (!dctx->domain) { goto error; } |