Re: kadm5_init_with_creds_ctx using the wrong server principal
Nico Williams <[email protected]>
| Newsgroups | gmane.comp.encryption.kerberos.heimdal.general |
|---|---|
| Message-ID | <CAK3OfOjpV3SURSaazG5C=OXzn+inUJ0MZrRjmU_9Bdc3tM6PxA@mail.gmail.com> |
Ultimately the string "kadmin/admin" here gets passed to krb5_parse_name(), and since there's no @REALM in the string, the library will just use the default realm to qualify the name. The caller of krb5_parse_name() here is get_kadm_ticket(). Perhaps kadm5_init_with_creds_ctx() and get_kadm_ticket() could do something to ensure that the actual realm (which kadm5_init_with_creds_ctx() knows) gets used here. The way to do that with the existing krb5_parse*() interface would be to pass down the right realm to get_kadm_ticket(), then call krb5_parse_name_flags() with KRB5_PRINCIPAL_PARSE_NO_REALM set in flags, then change the realm of the resulting principal or, on error, call krb5_parse_name_flags() with KRB5_PRINCIPAL_PARSE_REQUIRE_REALM. Nico --