/***************************************************************************
Set a fixed challenge
***************************************************************************/
-BOOL auth_challenge_may_be_modified(struct auth_context *auth_ctx)
+bool auth_challenge_may_be_modified(struct auth_context *auth_ctx)
{
return auth_ctx->challenge.may_be_modified;
}
NT_STATUS_HAVE_NO_MEMORY(auth_ctx->challenge.data.data);
auth_ctx->challenge.set_by = "random";
- auth_ctx->challenge.may_be_modified = True;
+ auth_ctx->challenge.may_be_modified = true;
}
DEBUG(10,("auth_get_challenge: challenge set by %s\n",
}
struct auth_check_password_sync_state {
- BOOL finished;
+ bool finished;
NTSTATUS status;
struct auth_serversupplied_info *server_info;
};
struct auth_check_password_sync_state *s = talloc_get_type(private_data,
struct auth_check_password_sync_state);
- s->finished = True;
+ s->finished = true;
s->status = auth_check_password_recv(req, s, &s->server_info);
}
req->callback.private_data = private_data;
if (!user_info->mapped_state) {
- nt_status = map_user_info(req, user_info, &user_info_tmp);
+ nt_status = map_user_info(req, lp_workgroup(auth_ctx->lp_ctx), user_info, &user_info_tmp);
if (!NT_STATUS_IS_OK(nt_status)) goto failed;
user_info = user_info_tmp;
req->user_info = user_info_tmp;
NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char **methods,
struct event_context *ev,
struct messaging_context *msg,
+ struct loadparm_context *lp_ctx,
struct auth_context **auth_ctx)
{
int i;
ctx = talloc(mem_ctx, struct auth_context);
NT_STATUS_HAVE_NO_MEMORY(ctx);
ctx->challenge.set_by = NULL;
- ctx->challenge.may_be_modified = False;
+ ctx->challenge.may_be_modified = false;
ctx->challenge.data = data_blob(NULL, 0);
ctx->methods = NULL;
ctx->event_ctx = ev;
ctx->msg_ctx = msg;
+ ctx->lp_ctx = lp_ctx;
for (i=0; methods[i] ; i++) {
struct auth_method_context *method;
NTSTATUS auth_context_create(TALLOC_CTX *mem_ctx,
struct event_context *ev,
struct messaging_context *msg,
+ struct loadparm_context *lp_ctx,
struct auth_context **auth_ctx)
{
const char **auth_methods = NULL;
- switch (lp_server_role(global_loadparm)) {
+ switch (lp_server_role(lp_ctx)) {
case ROLE_STANDALONE:
- auth_methods = lp_parm_string_list(NULL, "auth methods", "standalone", NULL);
+ auth_methods = lp_parm_string_list(mem_ctx, lp_ctx, NULL, "auth methods", "standalone", NULL);
break;
case ROLE_DOMAIN_MEMBER:
- auth_methods = lp_parm_string_list(NULL, "auth methods", "member server", NULL);
+ auth_methods = lp_parm_string_list(mem_ctx, lp_ctx, NULL, "auth methods", "member server", NULL);
break;
case ROLE_DOMAIN_CONTROLLER:
- auth_methods = lp_parm_string_list(NULL, "auth methods", "domain controller", NULL);
+ auth_methods = lp_parm_string_list(mem_ctx, lp_ctx, NULL, "auth methods", "domain controller", NULL);
break;
}
- return auth_context_create_methods(mem_ctx, auth_methods, ev, msg, auth_ctx);
+ return auth_context_create_methods(mem_ctx, auth_methods, ev, msg, lp_ctx, auth_ctx);
}
NTSTATUS auth_init(void)
{
- static BOOL initialized = False;
+ static bool initialized = false;
init_module_fn static_init[] = STATIC_auth_MODULES;
- init_module_fn *shared_init;
if (initialized) return NT_STATUS_OK;
- initialized = True;
+ initialized = true;
- shared_init = load_samba_modules(NULL, "auth");
-
run_init_functions(static_init);
- run_init_functions(shared_init);
-
- talloc_free(shared_init);
return NT_STATUS_OK;
}