From d11e7faa2a3464ed921ccf88a02e0a48871484b4 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek@redhat.com>
Date: Fri, 24 Mar 2017 20:36:06 +0100
Subject: [PATCH 66/72] PAM: Remove unneeded memory context
Since we only store data into pam_ctx in get_public_domains(), it
doesn't make sense to allow passing a separate memory context. It is
always going to be pam_ctx, otherwise the memory hierarchy will cause
issues anyway.
Reviewed-by: Sumit Bose <sbose@redhat.com>
---
src/responder/pam/pamsrv.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/responder/pam/pamsrv.c b/src/responder/pam/pamsrv.c
index 816f2293130ff8761ca94b4a42ca93063c11ea35..ab3f4545520f3fcb2492a6089a039c46f0fb847f 100644
--- a/src/responder/pam/pamsrv.c
+++ b/src/responder/pam/pamsrv.c
@@ -122,7 +122,7 @@ done:
return ret;
}
-static errno_t get_public_domains(TALLOC_CTX *mem_ctx, struct pam_ctx *pctx)
+static errno_t get_public_domains(struct pam_ctx *pctx)
{
char *domains_str = NULL;
errno_t ret;
@@ -137,7 +137,7 @@ static errno_t get_public_domains(TALLOC_CTX *mem_ctx, struct pam_ctx *pctx)
if (strcmp(domains_str, ALL_DOMAIMS_ARE_PUBLIC) == 0) { /* all */
/* copy all domains */
- ret = get_dom_names(mem_ctx,
+ ret = get_dom_names(pctx,
pctx->rctx->domains,
&pctx->public_domains,
&pctx->public_domains_count);
@@ -149,7 +149,7 @@ static errno_t get_public_domains(TALLOC_CTX *mem_ctx, struct pam_ctx *pctx)
pctx->public_domains = NULL;
pctx->public_domains_count = 0;
} else {
- ret = split_on_separator(mem_ctx, domains_str, ',', true, false,
+ ret = split_on_separator(pctx, domains_str, ',', true, false,
&pctx->public_domains,
&pctx->public_domains_count);
if (ret != EOK) {
@@ -212,7 +212,7 @@ static int pam_process_init(TALLOC_CTX *mem_ctx,
goto done;
}
- ret = get_public_domains(pctx, pctx);
+ ret = get_public_domains(pctx);
if (ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE, "get_public_domains failed: %d:[%s].\n",
ret, sss_strerror(ret));
--
2.9.3