From b011330c77168cdd864aaae54a75214935136c05 Mon Sep 17 00:00:00 2001 From: Pavel Reichl Date: Mon, 21 Jul 2014 13:12:07 +0100 Subject: UTIL: rename find_subdomain_by_object_name The function was named "find_subdomain" yet it could find both main domain and subdomain. Reviewed-by: Jakub Hrozek --- src/providers/simple/simple_access_check.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/providers/simple') diff --git a/src/providers/simple/simple_access_check.c b/src/providers/simple/simple_access_check.c index 1fcff445f..13c66d58f 100644 --- a/src/providers/simple/simple_access_check.c +++ b/src/providers/simple/simple_access_check.c @@ -50,8 +50,8 @@ simple_check_users(struct simple_ctx *ctx, const char *username, /* First, check whether the user is in the allowed users list */ if (ctx->allow_users != NULL) { for(i = 0; ctx->allow_users[i] != NULL; i++) { - domain = find_subdomain_by_object_name(ctx->domain, - ctx->allow_users[i]); + domain = find_domain_by_object_name(ctx->domain, + ctx->allow_users[i]); if (domain == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, "Invalid user %s!\n", ctx->allow_users[i]); @@ -83,8 +83,8 @@ simple_check_users(struct simple_ctx *ctx, const char *username, /* Next check whether this user has been specifically denied */ if (ctx->deny_users != NULL) { for(i = 0; ctx->deny_users[i] != NULL; i++) { - domain = find_subdomain_by_object_name(ctx->domain, - ctx->deny_users[i]); + domain = find_domain_by_object_name(ctx->domain, + ctx->deny_users[i]); if (domain == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, "Invalid user %s!\n", ctx->deny_users[i]); @@ -122,8 +122,8 @@ simple_check_groups(struct simple_ctx *ctx, const char **group_names, if (ctx->allow_groups && !*access_granted) { matched = false; for (i = 0; ctx->allow_groups[i]; i++) { - domain = find_subdomain_by_object_name(ctx->domain, - ctx->allow_groups[i]); + domain = find_domain_by_object_name(ctx->domain, + ctx->allow_groups[i]); if (domain == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, "Invalid group %s!\n", ctx->allow_groups[i]); @@ -155,8 +155,8 @@ simple_check_groups(struct simple_ctx *ctx, const char **group_names, if (ctx->deny_groups) { matched = false; for (i = 0; ctx->deny_groups[i]; i++) { - domain = find_subdomain_by_object_name(ctx->domain, - ctx->deny_groups[i]); + domain = find_domain_by_object_name(ctx->domain, + ctx->deny_groups[i]); if (domain == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, "Invalid group %s!\n", ctx->deny_groups[i]); @@ -417,7 +417,7 @@ simple_check_get_groups_send(TALLOC_CTX *mem_ctx, DEBUG(SSSDBG_TRACE_LIBS, "Looking up groups for user %s\n", username); /* get domain from username */ - state->domain = find_subdomain_by_object_name(ctx->domain, username); + state->domain = find_domain_by_object_name(ctx->domain, username); if (state->domain == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, "Invalid user %s!\n", username); ret = EINVAL; -- cgit