diff options
author | Simo Sorce <simo@redhat.com> | 2013-01-06 17:17:25 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-01-15 10:49:20 +0100 |
commit | 58fd3aa25c5292bc67432647ab7e5059439fcc6d (patch) | |
tree | 54d9c27c24d910d412875fd6cdc2660f9dae743f /src/responder | |
parent | 73120327cc136229d56d08f7f8c5e8df4129c1e3 (diff) | |
download | sssd-58fd3aa25c5292bc67432647ab7e5059439fcc6d.tar.gz sssd-58fd3aa25c5292bc67432647ab7e5059439fcc6d.tar.bz2 sssd-58fd3aa25c5292bc67432647ab7e5059439fcc6d.zip |
Pass domain to sysdb_get<pw/gr>nam() functions
Also allows us to remove sysdb_subdom_get<pw/gr>nam() wrappers and restore
fqnames proper value in subdomains, by testing for a parent domain being
present or not.
Diffstat (limited to 'src/responder')
-rw-r--r-- | src/responder/nss/nsssrv_cmd.c | 14 | ||||
-rw-r--r-- | src/responder/pam/pamsrv_cmd.c | 4 | ||||
-rw-r--r-- | src/responder/sudo/sudosrv_get_sudorules.c | 2 |
3 files changed, 7 insertions, 13 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c index 55543f07..7e33d922 100644 --- a/src/responder/nss/nsssrv_cmd.c +++ b/src/responder/nss/nsssrv_cmd.c @@ -297,7 +297,7 @@ static int fill_pwent(struct sss_packet *packet, size_t dom_len = 0; int delim = 1; int i, ret, num, t; - bool add_domain = dom->fqnames; + bool add_domain = (dom->fqnames && (dom->parent == NULL)); const char *domain = dom->name; const char *namefmt; bool packet_initialized = false; @@ -759,9 +759,7 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx *dctx) return EIO; } - /* if this is a subdomain we need to search for the fully qualified - * name in the database */ - ret = sysdb_subdom_getpwnam(cmdctx, sysdb, name, &dctx->res); + ret = sysdb_getpwnam(cmdctx, sysdb, dom, name, &dctx->res); if (ret != EOK) { DEBUG(1, ("Failed to make request to our cache!\n")); return EIO; @@ -1926,7 +1924,7 @@ static int fill_members(struct sss_packet *packet, size_t blen; const char *domain = dom->name; - bool add_domain = dom->fqnames; + bool add_domain = (dom->fqnames && (dom->parent == NULL)); if (add_domain) { delim = 1; @@ -2055,7 +2053,7 @@ static int fill_grent(struct sss_packet *packet, int i = 0; int ret, num, memnum; size_t rzero, rsize; - bool add_domain = dom->fqnames; + bool add_domain = (dom->fqnames && (dom->parent == NULL)); const char *domain = dom->name; const char *namefmt; TALLOC_CTX *tmp_ctx = NULL; @@ -2358,9 +2356,7 @@ static int nss_cmd_getgrnam_search(struct nss_dom_ctx *dctx) return EIO; } - /* if this is a subdomain we need to search for the fully qualified - * name in the database */ - ret = sysdb_subdom_getgrnam(cmdctx, sysdb, name, &dctx->res); + ret = sysdb_getgrnam(cmdctx, sysdb, dom, name, &dctx->res); if (ret != EOK) { DEBUG(1, ("Failed to make request to our cache!\n")); return EIO; diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c index 813894d3..fa8eabf6 100644 --- a/src/responder/pam/pamsrv_cmd.c +++ b/src/responder/pam/pamsrv_cmd.c @@ -1239,9 +1239,7 @@ static int pam_check_user_search(struct pam_auth_req *preq) return EFAULT; } - /* if this is a subdomain we need to search for the fully qualified - * name in the database */ - ret = sysdb_subdom_getpwnam(preq, sysdb, name, &preq->res); + ret = sysdb_getpwnam(preq, sysdb, dom, name, &preq->res); if (ret != EOK) { DEBUG(1, ("Failed to make request to our cache!\n")); return EIO; diff --git a/src/responder/sudo/sudosrv_get_sudorules.c b/src/responder/sudo/sudosrv_get_sudorules.c index 5a78000c..ac8cb3ce 100644 --- a/src/responder/sudo/sudosrv_get_sudorules.c +++ b/src/responder/sudo/sudosrv_get_sudorules.c @@ -136,7 +136,7 @@ static errno_t sudosrv_get_user(struct sudo_dom_ctx *dctx) goto done; } - ret = sysdb_getpwnam(dctx, sysdb, name, &user); + ret = sysdb_getpwnam(dctx, sysdb, dctx->domain, name, &user); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, ("Failed to make request to our cache!\n")); |