Example #1
0
static NTSTATUS make_auth_context_text_list(struct auth_context **auth_context, char **text_list) 
{
	auth_methods *list = NULL;
	auth_methods *t = NULL;
	auth_methods *tmp;
	NTSTATUS nt_status;

	if (!text_list) {
		DEBUG(2,("make_auth_context_text_list: No auth method list!?\n"));
		return NT_STATUS_UNSUCCESSFUL;
	}
	
	if (!NT_STATUS_IS_OK(nt_status = make_auth_context(auth_context)))
		return nt_status;

	for (;*text_list; text_list++) { 
		if (load_auth_module(*auth_context, *text_list, &t)) {
		    DLIST_ADD_END(list, t, tmp);
		}
	}
	
	(*auth_context)->auth_method_list = list;
	
	return nt_status;
}
Example #2
0
/* module initialisation */
static NTSTATUS auth_init_winbind(struct auth_context *auth_context, const char *param, auth_methods **auth_method) 
{
	if (!make_auth_methods(auth_context, auth_method)) {
		return NT_STATUS_NO_MEMORY;
	}

	(*auth_method)->name = "winbind";
	(*auth_method)->auth = check_winbind_security;

	if (param && *param) {
		/* we load the 'fallback' module - if winbind isn't here, call this
		   module */
		if (!load_auth_module(auth_context, param, (auth_methods **)&(*auth_method)->private_data)) {
			return NT_STATUS_UNSUCCESSFUL;
		}
		
	}
	return NT_STATUS_OK;
}
Example #3
0
/* module initialisation */
static NTSTATUS auth_init_script(struct auth_context *auth_context, const char *param, auth_methods **auth_method) 
{
	if (!make_auth_methods(auth_context, auth_method)) {
		return NT_STATUS_NO_MEMORY;
	}

	(*auth_method)->name = "script";
	(*auth_method)->auth = script_check_user_credentials;

	if (param && *param) {
		/* we load the 'fallback' module - if script isn't here, call this
		   module */
		auth_methods *priv;
		if (!load_auth_module(auth_context, param, &priv)) {
			return NT_STATUS_UNSUCCESSFUL;
		}
		(*auth_method)->private_data = (void *)priv;
	}
	return NT_STATUS_OK;
}
Example #4
0
File: auth.c Project: sprymak/samba
static NTSTATUS make_auth_context_text_list(TALLOC_CTX *mem_ctx,
					    struct auth_context **auth_context,
					    char **text_list)
{
	auth_methods *list = NULL;
	auth_methods *t, *method = NULL;
	NTSTATUS nt_status;

	if (!text_list) {
		DEBUG(2,("make_auth_context_text_list: No auth method list!?\n"));
		return NT_STATUS_UNSUCCESSFUL;
	}

	nt_status = make_auth_context(mem_ctx, auth_context);

	if (!NT_STATUS_IS_OK(nt_status)) {
		return nt_status;
	}

	for (;*text_list; text_list++) { 
		if (load_auth_module(*auth_context, *text_list, &t)) {
		    DLIST_ADD_END(list, t, auth_methods *);
		}
	}

	(*auth_context)->auth_method_list = list;

	/* Look for the first module to provide a prepare_gensec and
	 * make_auth4_context hook, and set that if provided */
	for (method = (*auth_context)->auth_method_list; method; method = method->next) {
		if (method->prepare_gensec && method->make_auth4_context) {
			(*auth_context)->prepare_gensec = method->prepare_gensec;
			(*auth_context)->make_auth4_context = method->make_auth4_context;
			break;
		}
	}
	return NT_STATUS_OK;
}
Example #5
0
/* module initialisation */
static NTSTATUS auth_init_winbind(struct auth_context *auth_context, const char *param, auth_methods **auth_method)
{
    struct auth_methods *result;

    result = TALLOC_ZERO_P(auth_context, struct auth_methods);
    if (result == NULL) {
        return NT_STATUS_NO_MEMORY;
    }
    result->name = "winbind";
    result->auth = check_winbind_security;

    if (param && *param) {
        /* we load the 'fallback' module - if winbind 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 = result;
    return NT_STATUS_OK;
}