Blame SOURCES/0066-PAM-Remove-unneeded-memory-context.patch

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