|
|
b2d430 |
From ab6ee9104826e286e0c67c9176c08b9a239e0622 Mon Sep 17 00:00:00 2001
|
|
|
b2d430 |
From: Jakub Hrozek <jhrozek@redhat.com>
|
|
|
b2d430 |
Date: Tue, 26 Jul 2016 12:13:43 +0200
|
|
|
b2d430 |
Subject: [PATCH 85/86] SIMPLE: Make the DP handlers testable
|
|
|
b2d430 |
MIME-Version: 1.0
|
|
|
b2d430 |
Content-Type: text/plain; charset=UTF-8
|
|
|
b2d430 |
Content-Transfer-Encoding: 8bit
|
|
|
b2d430 |
|
|
|
b2d430 |
To make it possible to call the whole DP handler in the unit test, not
|
|
|
b2d430 |
just the evaluator part.
|
|
|
b2d430 |
|
|
|
b2d430 |
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
|
|
|
b2d430 |
---
|
|
|
b2d430 |
Makefile.am | 1 +
|
|
|
b2d430 |
src/providers/simple/simple_access.c | 5 ++--
|
|
|
b2d430 |
src/providers/simple/simple_access_pvt.h | 43 ++++++++++++++++++++++++++++++++
|
|
|
b2d430 |
3 files changed, 47 insertions(+), 2 deletions(-)
|
|
|
b2d430 |
create mode 100644 src/providers/simple/simple_access_pvt.h
|
|
|
b2d430 |
|
|
|
b2d430 |
diff --git a/Makefile.am b/Makefile.am
|
|
|
b2d430 |
index cefd9a43442fc19933f1e373d4f2ed4bb3ba3201..ee9b48c666a44781b582ba5d83102b705e898f29 100644
|
|
|
b2d430 |
--- a/Makefile.am
|
|
|
b2d430 |
+++ b/Makefile.am
|
|
|
b2d430 |
@@ -665,6 +665,7 @@ dist_noinst_HEADERS = \
|
|
|
b2d430 |
src/providers/fail_over_srv.h \
|
|
|
b2d430 |
src/util/child_common.h \
|
|
|
b2d430 |
src/providers/simple/simple_access.h \
|
|
|
b2d430 |
+ src/providers/simple/simple_access_pvt.h \
|
|
|
b2d430 |
src/providers/krb5/krb5_auth.h \
|
|
|
b2d430 |
src/providers/krb5/krb5_common.h \
|
|
|
b2d430 |
src/providers/krb5/krb5_utils.h \
|
|
|
b2d430 |
diff --git a/src/providers/simple/simple_access.c b/src/providers/simple/simple_access.c
|
|
|
b2d430 |
index 577e8354e9b574764734248b2bde4ef06c6fb4fc..521beee84833b47b547bd1045c24e3384aa4d9a5 100644
|
|
|
b2d430 |
--- a/src/providers/simple/simple_access.c
|
|
|
b2d430 |
+++ b/src/providers/simple/simple_access.c
|
|
|
b2d430 |
@@ -22,6 +22,7 @@
|
|
|
b2d430 |
#include <security/pam_modules.h>
|
|
|
b2d430 |
|
|
|
b2d430 |
#include "providers/simple/simple_access.h"
|
|
|
b2d430 |
+#include "providers/simple/simple_access_pvt.h"
|
|
|
b2d430 |
#include "util/sss_utf8.h"
|
|
|
b2d430 |
#include "providers/backend.h"
|
|
|
b2d430 |
#include "db/sysdb.h"
|
|
|
b2d430 |
@@ -176,7 +177,7 @@ struct simple_access_handler_state {
|
|
|
b2d430 |
|
|
|
b2d430 |
static void simple_access_handler_done(struct tevent_req *subreq);
|
|
|
b2d430 |
|
|
|
b2d430 |
-static struct tevent_req *
|
|
|
b2d430 |
+struct tevent_req *
|
|
|
b2d430 |
simple_access_handler_send(TALLOC_CTX *mem_ctx,
|
|
|
b2d430 |
struct simple_ctx *simple_ctx,
|
|
|
b2d430 |
struct pam_data *pd,
|
|
|
b2d430 |
@@ -265,7 +266,7 @@ done:
|
|
|
b2d430 |
tevent_req_done(req);
|
|
|
b2d430 |
}
|
|
|
b2d430 |
|
|
|
b2d430 |
-static errno_t
|
|
|
b2d430 |
+errno_t
|
|
|
b2d430 |
simple_access_handler_recv(TALLOC_CTX *mem_ctx,
|
|
|
b2d430 |
struct tevent_req *req,
|
|
|
b2d430 |
struct pam_data **_data)
|
|
|
b2d430 |
diff --git a/src/providers/simple/simple_access_pvt.h b/src/providers/simple/simple_access_pvt.h
|
|
|
b2d430 |
new file mode 100644
|
|
|
b2d430 |
index 0000000000000000000000000000000000000000..c133e1c5531be35861178e0b23aa7a09db9f7703
|
|
|
b2d430 |
--- /dev/null
|
|
|
b2d430 |
+++ b/src/providers/simple/simple_access_pvt.h
|
|
|
b2d430 |
@@ -0,0 +1,43 @@
|
|
|
b2d430 |
+/*
|
|
|
b2d430 |
+ SSSD
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+ Simple access control
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+ Copyright (C) Sumit Bose <sbose@redhat.com> 2010
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+ This program is free software; you can redistribute it and/or modify
|
|
|
b2d430 |
+ it under the terms of the GNU General Public License as published by
|
|
|
b2d430 |
+ the Free Software Foundation; either version 3 of the License, or
|
|
|
b2d430 |
+ (at your option) any later version.
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+ This program is distributed in the hope that it will be useful,
|
|
|
b2d430 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
b2d430 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
b2d430 |
+ GNU General Public License for more details.
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+ You should have received a copy of the GNU General Public License
|
|
|
b2d430 |
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
b2d430 |
+*/
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+#ifndef __SIMPLE_ACCESS_PVT_H__
|
|
|
b2d430 |
+#define __SIMPLE_ACCESS_PVT_H__
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+#include "providers/data_provider/dp.h"
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+/* We only 'export' the functions in a private header file to be able to call
|
|
|
b2d430 |
+ * them from unit tests
|
|
|
b2d430 |
+ */
|
|
|
b2d430 |
+struct tevent_req *
|
|
|
b2d430 |
+simple_access_handler_send(TALLOC_CTX *mem_ctx,
|
|
|
b2d430 |
+ struct simple_ctx *simple_ctx,
|
|
|
b2d430 |
+ struct pam_data *pd,
|
|
|
b2d430 |
+ struct dp_req_params *params);
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+errno_t
|
|
|
b2d430 |
+simple_access_handler_recv(TALLOC_CTX *mem_ctx,
|
|
|
b2d430 |
+ struct tevent_req *req,
|
|
|
b2d430 |
+ struct pam_data **_data);
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+int simple_access_obtain_filter_lists(struct simple_ctx *ctx);
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+#endif /* __SIMPLE_ACCESS_PVT_H__ */
|
|
|
b2d430 |
--
|
|
|
b2d430 |
2.4.11
|
|
|
b2d430 |
|