From 329c4d12f9a08d9499f9982076bdd9e614fbdd63 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Mon, 17 Oct 2011 15:53:19 +0200 Subject: [PATCH] s3-auth: fix the build of skel auth example module. Guenther --- examples/auth/auth_skel.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/examples/auth/auth_skel.c b/examples/auth/auth_skel.c index e6cbd73968f..4352251f4ad 100644 --- a/examples/auth/auth_skel.c +++ b/examples/auth/auth_skel.c @@ -19,6 +19,7 @@ */ #include "includes.h" +#include "auth.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_AUTH @@ -26,8 +27,8 @@ static NTSTATUS check_skel_security(const struct auth_context *auth_context, void *my_private_data, TALLOC_CTX *mem_ctx, - const auth_usersupplied_info *user_info, - auth_serversupplied_info **server_info) + const struct auth_usersupplied_info *user_info, + struct auth_serversupplied_info **server_info) { if (!user_info || !auth_context) { return NT_STATUS_LOGON_FAILURE; @@ -43,12 +44,26 @@ static NTSTATUS check_skel_security(const struct auth_context *auth_context, /* module initialisation */ NTSTATUS auth_init_skel(struct auth_context *auth_context, const char *param, auth_methods **auth_method) { - if (!make_auth_methods(auth_context, auth_method)) { + struct auth_methods *result; + + result = talloc_zero(auth_context, struct auth_methods); + if (result == NULL) { return NT_STATUS_NO_MEMORY; } + result->name = "skel"; + result->auth = check_skel_security; + + if (param && *param) { + /* we load the 'fallback' module - if skel isn't here, call this + module */ + auth_methods *priv; + if (!load_auth_module(auth_context, param, &priv)) { + return NT_STATUS_UNSUCCESSFUL; + } + result->private_data = (void *)priv; + } - (*auth_method)->auth = check_skel_security; - (*auth_method)->name = "skel"; + *auth_method = result; return NT_STATUS_OK; } -- 2.34.1