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/responder/nss/nsssrv_netgroup.c2
-rw-r--r--src/tests/sysdb-tests.c6
4 files changed, 11 insertions, 7 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index fa6c2735..151cd7f9 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -501,6 +501,7 @@ struct sysdb_netgroup_ctx {
errno_t sysdb_getnetgr(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *netgroup,
struct ldb_result **res);
@@ -517,6 +518,7 @@ int sysdb_get_user_attr(TALLOC_CTX *mem_ctx,
int sysdb_get_netgroup_attr(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *netgrname,
const char **attributes,
struct ldb_result **res);
diff --git a/src/db/sysdb_search.c b/src/db/sysdb_search.c
index 4a279526..34379d48 100644
--- a/src/db/sysdb_search.c
+++ b/src/db/sysdb_search.c
@@ -782,6 +782,7 @@ done:
errno_t sysdb_getnetgr(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *netgroup,
struct ldb_result **res)
{
@@ -801,7 +802,7 @@ errno_t sysdb_getnetgr(TALLOC_CTX *mem_ctx,
base_dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb,
SYSDB_TMPL_NETGROUP_BASE,
- sysdb->domain->name);
+ domain->name);
if (!base_dn) {
ret = ENOMEM;
goto done;
@@ -813,7 +814,7 @@ errno_t sysdb_getnetgr(TALLOC_CTX *mem_ctx,
}
netgroup_dn = talloc_asprintf(tmp_ctx, SYSDB_TMPL_NETGROUP,
- sanitized_netgroup, sysdb->domain->name);
+ sanitized_netgroup, domain->name);
if (!netgroup_dn) {
ret = ENOMEM;
goto done;
@@ -839,6 +840,7 @@ done:
int sysdb_get_netgroup_attr(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *netgrname,
const char **attributes,
struct ldb_result **res)
@@ -855,7 +857,7 @@ int sysdb_get_netgroup_attr(TALLOC_CTX *mem_ctx,
}
base_dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb,
- SYSDB_TMPL_NETGROUP_BASE, sysdb->domain->name);
+ SYSDB_TMPL_NETGROUP_BASE, domain->name);
if (!base_dn) {
ret = ENOMEM;
goto done;
diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c
index 4b10b181..e6debffa 100644
--- a/src/responder/nss/nsssrv_netgroup.c
+++ b/src/responder/nss/nsssrv_netgroup.c
@@ -457,7 +457,7 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx)
}
/* Look up the netgroup in the cache */
- ret = sysdb_getnetgr(step_ctx->dctx, sysdb, name,
+ ret = sysdb_getnetgr(step_ctx->dctx, sysdb, dom, name,
&step_ctx->dctx->res);
if (ret == ENOENT) {
/* This netgroup was not found in this domain */
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c
index c60d4766..7cf5a3e0 100644
--- a/src/tests/sysdb-tests.c
+++ b/src/tests/sysdb-tests.c
@@ -3648,7 +3648,7 @@ START_TEST (test_sysdb_get_netgroup_attr)
netgrname = talloc_asprintf(test_ctx, "testnetgr%d", _i);
ret = sysdb_get_netgroup_attr(test_ctx, test_ctx->sysdb,
- netgrname, attrs, &res);
+ test_ctx->domain, netgrname, attrs, &res);
fail_if(ret != EOK, "Could not get netgroup attributes");
fail_if(res->count != 1,
@@ -3778,14 +3778,14 @@ START_TEST(test_odd_characters)
/* Retrieve */
ret = sysdb_getnetgr(test_ctx, test_ctx->sysdb,
- odd_netgroupname, &res);
+ test_ctx->domain, odd_netgroupname, &res);
fail_unless(ret == EOK, "sysdb_getnetgr error [%d][%s]",
ret, strerror(ret));
fail_unless(res->count == 1, "Received [%d] responses",
res->count);
talloc_zfree(res);
- ret = sysdb_get_netgroup_attr(test_ctx, test_ctx->sysdb,
+ ret = sysdb_get_netgroup_attr(test_ctx, test_ctx->sysdb, test_ctx->domain,
odd_netgroupname, netgr_attrs, &res);
fail_unless(ret == EOK, "sysdb_get_netgroup_attr error [%d][%s]",
ret, strerror(ret));