summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-03-27 15:23:23 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-03-29 15:06:58 -0400
commitfcbaf4c73d3af215492f0907a6a3a46602a0e753 (patch)
tree909f852d7b8ea3d12b141aa71cc7752f6b3c1993 /src
parent215280b9af59ab28abc501c242e4802984c9281a (diff)
downloadsssd-fcbaf4c73d3af215492f0907a6a3a46602a0e753.tar.gz
sssd-fcbaf4c73d3af215492f0907a6a3a46602a0e753.tar.bz2
sssd-fcbaf4c73d3af215492f0907a6a3a46602a0e753.zip
Fix off-by-one error in principal selection
https://fedorahosted.org/sssd/ticket/1269
Diffstat (limited to 'src')
-rw-r--r--src/util/sss_krb5.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/sss_krb5.c b/src/util/sss_krb5.c
index 75ce2a59..73bd5b8e 100644
--- a/src/util/sss_krb5.c
+++ b/src/util/sss_krb5.c
@@ -390,7 +390,7 @@ static bool match_principal(krb5_context ctx,
const char *realm_name;
int realm_len;
- int mode = MODE_NORMAL;
+ enum matching_mode mode = MODE_NORMAL;
TALLOC_CTX *tmp_ctx;
bool ret = false;
@@ -404,10 +404,10 @@ static bool match_principal(krb5_context ctx,
if (pattern_primary) {
tmp_len = strlen(pattern_primary);
- if (pattern_primary[tmp_len] == '*') {
+ if (pattern_primary[tmp_len-1] == '*') {
mode = MODE_PREFIX;
primary_str = talloc_strdup(tmp_ctx, pattern_primary);
- primary_str[tmp_len] = '\0';
+ primary_str[tmp_len-1] = '\0';
primary_str_len = tmp_len-1;
} else if (pattern_primary[0] == '*') {
mode = MODE_POSTFIX;