summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/db/sysdb.h2
-rw-r--r--src/db/sysdb_search.c8
-rw-r--r--src/providers/proxy/proxy_id.c6
-rw-r--r--src/responder/nss/nsssrv_cmd.c4
-rw-r--r--src/tests/sysdb-tests.c2
5 files changed, 14 insertions, 8 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 0c15cc66..350bb8db 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -461,6 +461,7 @@ int sysdb_getpwnam(TALLOC_CTX *mem_ctx,
int sysdb_getpwuid(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
uid_t uid,
struct ldb_result **res);
@@ -476,6 +477,7 @@ int sysdb_getgrnam(TALLOC_CTX *mem_ctx,
int sysdb_getgrgid(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
gid_t gid,
struct ldb_result **res);
diff --git a/src/db/sysdb_search.c b/src/db/sysdb_search.c
index 902a2637..03fef2ed 100644
--- a/src/db/sysdb_search.c
+++ b/src/db/sysdb_search.c
@@ -89,6 +89,7 @@ done:
int sysdb_getpwuid(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
uid_t uid,
struct ldb_result **_res)
{
@@ -105,7 +106,7 @@ int sysdb_getpwuid(TALLOC_CTX *mem_ctx,
}
base_dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb,
- SYSDB_TMPL_USER_BASE, sysdb->domain->name);
+ SYSDB_TMPL_USER_BASE, domain->name);
if (!base_dn) {
ret = ENOMEM;
goto done;
@@ -280,6 +281,7 @@ done:
int sysdb_getgrgid(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
gid_t gid,
struct ldb_result **_res)
{
@@ -299,11 +301,11 @@ int sysdb_getgrgid(TALLOC_CTX *mem_ctx,
if (sysdb->mpg) {
fmt_filter = SYSDB_GRGID_MPG_FILTER;
base_dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb,
- SYSDB_DOM_BASE, sysdb->domain->name);
+ SYSDB_DOM_BASE, domain->name);
} else {
fmt_filter = SYSDB_GRGID_FILTER;
base_dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb,
- SYSDB_TMPL_GROUP_BASE, sysdb->domain->name);
+ SYSDB_TMPL_GROUP_BASE, domain->name);
}
if (!base_dn) {
ret = ENOMEM;
diff --git a/src/providers/proxy/proxy_id.c b/src/providers/proxy/proxy_id.c
index aa98507b..76f27955 100644
--- a/src/providers/proxy/proxy_id.c
+++ b/src/providers/proxy/proxy_id.c
@@ -95,7 +95,7 @@ static int get_pw_name(TALLOC_CTX *mem_ctx,
/* Canonicalize the username in case it was actually an alias */
if (ctx->fast_alias == true) {
- ret = sysdb_getpwuid(tmpctx, sysdb, uid, &cached_pwd);
+ ret = sysdb_getpwuid(tmpctx, sysdb, dom, uid, &cached_pwd);
if (ret != EOK) {
/* Non-fatal, attempt to canonicalize online */
DEBUG(SSSDBG_TRACE_FUNC, ("Request to cache failed [%d]: %s\n",
@@ -819,7 +819,7 @@ static int get_gr_name(TALLOC_CTX *mem_ctx,
/* Canonicalize the group name in case it was actually an alias */
if (ctx->fast_alias == true) {
- ret = sysdb_getgrgid(tmpctx, sysdb, gid, &cached_grp);
+ ret = sysdb_getgrgid(tmpctx, sysdb, dom, gid, &cached_grp);
if (ret != EOK) {
/* Non-fatal, attempt to canonicalize online */
DEBUG(SSSDBG_TRACE_FUNC, ("Request to cache failed [%d]: %s\n",
@@ -1183,7 +1183,7 @@ static int get_initgr(TALLOC_CTX *mem_ctx,
/* Canonicalize the username in case it was actually an alias */
if (ctx->fast_alias == true) {
- ret = sysdb_getpwuid(tmpctx, sysdb, uid, &cached_pwd);
+ ret = sysdb_getpwuid(tmpctx, sysdb, dom, uid, &cached_pwd);
if (ret != EOK) {
/* Non-fatal, attempt to canonicalize online */
DEBUG(SSSDBG_TRACE_FUNC, ("Request to cache failed [%d]: %s\n",
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index 7e33d922..665aaf6c 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -1095,7 +1095,7 @@ static int nss_cmd_getpwuid_search(struct nss_dom_ctx *dctx)
return EIO;
}
- ret = sysdb_getpwuid(cmdctx, sysdb, cmdctx->id, &dctx->res);
+ ret = sysdb_getpwuid(cmdctx, sysdb, dom, cmdctx->id, &dctx->res);
if (ret != EOK) {
DEBUG(1, ("Failed to make request to our cache!\n"));
return EIO;
@@ -2670,7 +2670,7 @@ static int nss_cmd_getgrgid_search(struct nss_dom_ctx *dctx)
return EIO;
}
- ret = sysdb_getgrgid(cmdctx, sysdb, cmdctx->id, &dctx->res);
+ ret = sysdb_getgrgid(cmdctx, sysdb, dom, cmdctx->id, &dctx->res);
if (ret != EOK) {
DEBUG(1, ("Failed to make request to our cache!\n"));
return EIO;
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c
index 65e03fe0..06096ad9 100644
--- a/src/tests/sysdb-tests.c
+++ b/src/tests/sysdb-tests.c
@@ -960,6 +960,7 @@ START_TEST (test_sysdb_getgrgid)
ret = sysdb_getgrgid(test_ctx,
test_ctx->sysdb,
+ test_ctx->domain,
_i, &res);
if (ret) {
fail("sysdb_getgrgid failed for gid %d (%d: %s)",
@@ -1000,6 +1001,7 @@ START_TEST (test_sysdb_getpwuid)
ret = sysdb_getpwuid(test_ctx,
test_ctx->sysdb,
+ test_ctx->domain,
_i, &res);
if (ret) {
fail("sysdb_getpwuid failed for uid %d (%d: %s)",