diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-10-15 12:55:06 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-10-17 13:43:58 +0200 |
commit | cf6b83e71b51cbd3765bfd5589a144e8363bb26d (patch) | |
tree | bad76ff2f8d9a1d906eaab6a6901a0e30f4c005f /src/providers/krb5 | |
parent | 8f5ac4e494f82b057978807af08d7bb286e7b5dc (diff) | |
download | sssd-cf6b83e71b51cbd3765bfd5589a144e8363bb26d.tar.gz sssd-cf6b83e71b51cbd3765bfd5589a144e8363bb26d.tar.bz2 sssd-cf6b83e71b51cbd3765bfd5589a144e8363bb26d.zip |
heimdal: Use sss_krb5_princ_realm where not yet
Diffstat (limited to 'src/providers/krb5')
-rw-r--r-- | src/providers/krb5/krb5_child.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c index e00c16ca..fe5ceb6e 100644 --- a/src/providers/krb5/krb5_child.c +++ b/src/providers/krb5/krb5_child.c @@ -397,7 +397,8 @@ static krb5_error_code create_empty_cred(krb5_context ctx, krb5_principal princ, { krb5_error_code kerr; krb5_creds *cred = NULL; - krb5_data *krb5_realm; + const char *realm_name; + int realm_length; cred = calloc(sizeof(krb5_creds), 1); if (cred == NULL) { @@ -411,12 +412,12 @@ static krb5_error_code create_empty_cred(krb5_context ctx, krb5_principal princ, goto done; } - krb5_realm = krb5_princ_realm(ctx, princ); + sss_krb5_princ_realm(ctx, princ, &realm_name, &realm_length); kerr = krb5_build_principal_ext(ctx, &cred->server, - krb5_realm->length, krb5_realm->data, + realm_length, realm_name, KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME, - krb5_realm->length, krb5_realm->data, 0); + realm_length, realm_name, 0); if (kerr != 0) { DEBUG(1, ("krb5_build_principal_ext failed.\n")); goto done; @@ -1701,7 +1702,8 @@ static errno_t k5c_recv_data(struct krb5_req *kr, int fd, uint32_t *offline) static int k5c_setup_fast(struct krb5_req *kr, char *lifetime_str, bool demand) { krb5_principal fast_princ_struct; - krb5_data *realm_data; + const char *realm_name; + int realm_length; char *fast_principal_realm; char *fast_principal; krb5_error_code kerr; @@ -1732,8 +1734,11 @@ static int k5c_setup_fast(struct krb5_req *kr, char *lifetime_str, bool demand) return KRB5KRB_ERR_GENERIC; } free(tmp_str); - realm_data = krb5_princ_realm(kr->ctx, fast_princ_struct); - fast_principal_realm = talloc_asprintf(kr, "%.*s", realm_data->length, realm_data->data); + sss_krb5_princ_realm(kr->ctx, fast_princ_struct, + &realm_name, &realm_length); + + fast_principal_realm = talloc_asprintf(kr, "%.*s", + realm_length, realm_name); if (!fast_principal_realm) { DEBUG(1, ("talloc_asprintf failed.\n")); return ENOMEM; |