diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-03-19 08:02:06 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-03-30 08:51:06 -0400 |
commit | ab39dad6572ebf2f0dda53d703d0323a848547d8 (patch) | |
tree | c754e18c2e662ec687eae39a09c267f8d818ef3d /src/providers | |
parent | aad27b6b3581e1f4244c4b22cfcb1534506bb68d (diff) | |
download | sssd-ab39dad6572ebf2f0dda53d703d0323a848547d8.tar.gz sssd-ab39dad6572ebf2f0dda53d703d0323a848547d8.tar.xz sssd-ab39dad6572ebf2f0dda53d703d0323a848547d8.zip |
Make the string_equal() function publicsssd-1.8.0-20.el6
Diffstat (limited to 'src/providers')
-rw-r--r-- | src/providers/simple/simple_access.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/providers/simple/simple_access.c b/src/providers/simple/simple_access.c index 06662e9df..e00079cd3 100644 --- a/src/providers/simple/simple_access.c +++ b/src/providers/simple/simple_access.c @@ -35,15 +35,6 @@ #define CONFDB_SIMPLE_ALLOW_GROUPS "simple_allow_groups" #define CONFDB_SIMPLE_DENY_GROUPS "simple_deny_groups" -static bool string_equal(bool cs, const char *s1, const char *s2) -{ - if (cs) { - return strcmp(s1, s2) == 0; - } - - return sss_utf8_case_eq((const uint8_t *)s1, (const uint8_t *)s2) == EOK; -} - errno_t simple_access_check(struct simple_ctx *ctx, const char *username, bool *access_granted) { @@ -68,7 +59,7 @@ errno_t simple_access_check(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++) { - if (string_equal(cs, username, ctx->allow_users[i])) { + if (sss_string_equal(cs, username, ctx->allow_users[i])) { DEBUG(9, ("User [%s] found in allow list, access granted.\n", username)); @@ -89,7 +80,7 @@ errno_t simple_access_check(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++) { - if (string_equal(cs, username, ctx->deny_users[i])) { + if (sss_string_equal(cs, username, ctx->deny_users[i])) { DEBUG(9, ("User [%s] found in deny list, access denied.\n", username)); @@ -200,7 +191,7 @@ errno_t simple_access_check(struct simple_ctx *ctx, const char *username, matched = false; for (i = 0; ctx->allow_groups[i]; i++) { for(j = 0; groups[j]; j++) { - if (string_equal(cs, groups[j], ctx->allow_groups[i])) { + if (sss_string_equal(cs, groups[j], ctx->allow_groups[i])) { matched = true; break; } @@ -221,7 +212,7 @@ errno_t simple_access_check(struct simple_ctx *ctx, const char *username, matched = false; for (i = 0; ctx->deny_groups[i]; i++) { for(j = 0; groups[j]; j++) { - if (string_equal(cs, groups[j], ctx->deny_groups[i])) { + if (sss_string_equal(cs, groups[j], ctx->deny_groups[i])) { matched = true; break; } |