summaryrefslogtreecommitdiffstats
path: root/src/providers/krb5/krb5_child_handler.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-10-18 16:25:57 +0200
committerSumit Bose <sbose@redhat.com>2012-10-26 10:32:05 +0200
commit916674f6c54a64980f181790befe861a6e2b8daf (patch)
treea3e7073af28acc012f70928745f19c5cb060144e /src/providers/krb5/krb5_child_handler.c
parent83f24636ef8d3d2b9c5be46272781ed5e0497ca7 (diff)
downloadsssd-916674f6c54a64980f181790befe861a6e2b8daf.tar.gz
sssd-916674f6c54a64980f181790befe861a6e2b8daf.tar.xz
sssd-916674f6c54a64980f181790befe861a6e2b8daf.zip
krb5_auth: send different_realm flag to krb5_child
The different_realm flag which was set by the responder is send to the krb5_child so that it can act differently on users from other realms. To avoid code duplication and inconsistent behaviour the krb5_child will not set the flag on its own but use the one from the provider.
Diffstat (limited to 'src/providers/krb5/krb5_child_handler.c')
-rw-r--r--src/providers/krb5/krb5_child_handler.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/providers/krb5/krb5_child_handler.c b/src/providers/krb5/krb5_child_handler.c
index 768d8c7dc..f0fe81b6f 100644
--- a/src/providers/krb5/krb5_child_handler.c
+++ b/src/providers/krb5/krb5_child_handler.c
@@ -92,6 +92,7 @@ static errno_t create_send_buffer(struct krb5child_req *kr,
size_t rp;
const char *keytab;
uint32_t validate;
+ uint32_t different_realm;
size_t username_len = 0;
keytab = dp_opt_get_cstring(kr->krb5_ctx->opts, KRB5_KEYTAB);
@@ -101,6 +102,7 @@ static errno_t create_send_buffer(struct krb5child_req *kr,
}
validate = dp_opt_get_bool(kr->krb5_ctx->opts, KRB5_VALIDATE) ? 1 : 0;
+ different_realm = kr->upn_from_different_realm ? 1 : 0;
buf = talloc(kr, struct io_buffer);
if (buf == NULL) {
@@ -108,7 +110,7 @@ static errno_t create_send_buffer(struct krb5child_req *kr,
return ENOMEM;
}
- buf->size = 6*sizeof(uint32_t) + strlen(kr->upn);
+ buf->size = 7*sizeof(uint32_t) + strlen(kr->upn);
if (kr->pd->cmd == SSS_PAM_AUTHENTICATE ||
kr->pd->cmd == SSS_CMD_RENEW ||
@@ -140,6 +142,7 @@ static errno_t create_send_buffer(struct krb5child_req *kr,
SAFEALIGN_COPY_UINT32(&buf->data[rp], &kr->gid, &rp);
SAFEALIGN_COPY_UINT32(&buf->data[rp], &validate, &rp);
SAFEALIGN_COPY_UINT32(&buf->data[rp], &kr->is_offline, &rp);
+ SAFEALIGN_COPY_UINT32(&buf->data[rp], &different_realm, &rp);
SAFEALIGN_SET_UINT32(&buf->data[rp], strlen(kr->upn), &rp);
safealign_memcpy(&buf->data[rp], kr->upn, strlen(kr->upn), &rp);