summaryrefslogtreecommitdiff
path: root/src/providers
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-12-21 19:17:42 +0100
committerStephen Gallagher <sgallagh@redhat.com>2011-12-21 14:47:41 -0500
commit85ecf49fdacd910f804caab1be7bf68d23702dc9 (patch)
treef2a3dcd490ce79c01c2800d46108f4b4cc81be8e /src/providers
parent65b813f8bb176d5db33cb486e1cc1bcd6dd8f1cc (diff)
downloadsssd-85ecf49fdacd910f804caab1be7bf68d23702dc9.tar.gz
sssd-85ecf49fdacd910f804caab1be7bf68d23702dc9.tar.bz2
sssd-85ecf49fdacd910f804caab1be7bf68d23702dc9.zip
Honor case sensitive flag when creating the ccname template
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/krb5/krb5_auth.c4
-rw-r--r--src/providers/krb5/krb5_utils.c16
-rw-r--r--src/providers/krb5/krb5_utils.h2
3 files changed, 17 insertions, 5 deletions
diff --git a/src/providers/krb5/krb5_auth.c b/src/providers/krb5/krb5_auth.c
index 6aaf7fbe..66cee473 100644
--- a/src/providers/krb5/krb5_auth.c
+++ b/src/providers/krb5/krb5_auth.c
@@ -626,7 +626,9 @@ static void krb5_find_ccache_step(struct tevent_req *req)
kr->ccname = expand_ccname_template(kr, kr,
dp_opt_get_cstring(kr->krb5_ctx->opts,
KRB5_CCNAME_TMPL),
- true, &private_path);
+ true,
+ state->be_ctx->domain->case_sensitive,
+ &private_path);
if (kr->ccname == NULL) {
DEBUG(1, ("expand_ccname_template failed.\n"));
ret = ENOMEM;
diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c
index 7fb0c8b3..2957598c 100644
--- a/src/providers/krb5/krb5_utils.c
+++ b/src/providers/krb5/krb5_utils.c
@@ -30,13 +30,14 @@
char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr,
const char *template, bool file_mode,
- bool *private_path)
+ bool case_sensitive, bool *private_path)
{
char *copy;
char *p;
char *n;
char *result = NULL;
char *dummy;
+ char *name;
char *res = NULL;
const char *cache_dir_tmpl;
TALLOC_CTX *tmp_ctx = NULL;
@@ -79,8 +80,16 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr,
"because user name is empty.\n"));
goto done;
}
+ name = sss_get_cased_name(tmp_ctx, kr->pd->user,
+ case_sensitive);
+ if (!name) {
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("sss_get_cased_name failed\n"));
+ goto done;
+ }
+
result = talloc_asprintf_append(result, "%s%s", p,
- kr->pd->user);
+ name);
if (!file_mode) *private_path = true;
break;
case 'U':
@@ -132,7 +141,8 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr,
}
dummy = expand_ccname_template(tmp_ctx, kr, cache_dir_tmpl,
- false, private_path);
+ false, case_sensitive,
+ private_path);
if (dummy == NULL) {
DEBUG(1, ("Expanding credential cache directory "
"template failed.\n"));
diff --git a/src/providers/krb5/krb5_utils.h b/src/providers/krb5/krb5_utils.h
index 8977e14f..7cc57d42 100644
--- a/src/providers/krb5/krb5_utils.h
+++ b/src/providers/krb5/krb5_utils.h
@@ -33,7 +33,7 @@
char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr,
const char *template, bool file_mode,
- bool *private_path);
+ bool case_sensitive, bool *private_path);
errno_t become_user(uid_t uid, gid_t gid);