diff options
author | Günther Deschner <gd@samba.org> | 2011-10-17 15:53:19 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2011-10-17 15:53:19 +0200 |
commit | 329c4d12f9a08d9499f9982076bdd9e614fbdd63 (patch) | |
tree | 11289f11f82d993b3180d942ef926716a0532209 /examples/auth/auth_skel.c | |
parent | ebcf45b5506013b2cbcc706e09f26198c07382d3 (diff) | |
download | samba-329c4d12f9a08d9499f9982076bdd9e614fbdd63.tar.gz samba-329c4d12f9a08d9499f9982076bdd9e614fbdd63.tar.xz samba-329c4d12f9a08d9499f9982076bdd9e614fbdd63.zip |
s3-auth: fix the build of skel auth example module.
Guenther
Diffstat (limited to 'examples/auth/auth_skel.c')
-rw-r--r-- | examples/auth/auth_skel.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/examples/auth/auth_skel.c b/examples/auth/auth_skel.c index e6cbd73968..4352251f4a 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; } |