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

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