summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap_async_connection.c
diff options
context:
space:
mode:
authorJan Zeleny <jzeleny@redhat.com>2011-11-01 10:19:04 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-11-02 14:10:31 -0400
commited80a7f8ff76089bdcfae7007dbdef42d05e2cc8 (patch)
treed2033a77c277be1c49cba8ff54e4d3d7070721d0 /src/providers/ldap/sdap_async_connection.c
parent7dfc7617085c403d30debe9f08d4c9bcca322744 (diff)
downloadsssd-ed80a7f8ff76089bdcfae7007dbdef42d05e2cc8.tar.gz
sssd-ed80a7f8ff76089bdcfae7007dbdef42d05e2cc8.tar.xz
sssd-ed80a7f8ff76089bdcfae7007dbdef42d05e2cc8.zip
Support to request canonicalization in LDAP/IPA provider
https://fedorahosted.org/sssd/ticket/957
Diffstat (limited to 'src/providers/ldap/sdap_async_connection.c')
-rw-r--r--src/providers/ldap/sdap_async_connection.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index c69b9bce0..076e7ee37 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -784,6 +784,7 @@ struct tevent_req *sdap_kinit_send(TALLOC_CTX *memctx,
const char *keytab,
const char *principal,
const char *realm,
+ bool canonicalize,
int lifetime)
{
struct tevent_req *req;
@@ -821,6 +822,18 @@ struct tevent_req *sdap_kinit_send(TALLOC_CTX *memctx,
}
}
+ if (canonicalize) {
+ ret = setenv("KRB5_CANONICALIZE", "true", 1);
+ } else {
+ ret = setenv("KRB5_CANONICALIZE", "false", 1);
+ }
+ if (ret == -1) {
+ DEBUG(2, ("Failed to set KRB5_CANONICALIZE to %s\n",
+ ((canonicalize)?"true":"false")));
+ talloc_free(req);
+ return NULL;
+ }
+
subreq = sdap_kinit_next_kdc(req);
if (!subreq) {
talloc_free(req);
@@ -1400,6 +1413,8 @@ static void sdap_cli_kinit_step(struct tevent_req *req)
dp_opt_get_string(state->opts->basic,
SDAP_SASL_AUTHID),
realm,
+ dp_opt_get_bool(state->opts->basic,
+ SDAP_KRB5_CANONICALIZE),
dp_opt_get_int(state->opts->basic,
SDAP_KRB5_TICKET_LIFETIME));
if (!subreq) {