mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-30 10:47:08 -06:00
Support getting in a principal with out the REALM part
This commit is contained in:
parent
19bdd1f166
commit
8de5f477d1
@ -2072,16 +2072,29 @@ static int ipapwd_setkeytab(Slapi_PBlock *pb)
|
|||||||
goto free_and_return;
|
goto free_and_return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* make sure it is a valid name */
|
||||||
krberr = krb5_parse_name(krbctx, serviceName, &krbname);
|
krberr = krb5_parse_name(krbctx, serviceName, &krbname);
|
||||||
if (krberr) {
|
if (krberr) {
|
||||||
|
slapi_ch_free_string(&serviceName);
|
||||||
slapi_log_error(SLAPI_LOG_FATAL, "ipa_pwd_extop", "krb5_parse_name failed\n");
|
slapi_log_error(SLAPI_LOG_FATAL, "ipa_pwd_extop", "krb5_parse_name failed\n");
|
||||||
rc = LDAP_OPERATIONS_ERROR;
|
rc = LDAP_OPERATIONS_ERROR;
|
||||||
goto free_and_return;
|
goto free_and_return;
|
||||||
|
} else {
|
||||||
|
/* invert so that we get the canonical form (add REALM if not present for example) */
|
||||||
|
char *canonname;
|
||||||
|
krberr = krb5_unparse_name(krbctx, krbname, &canonname);
|
||||||
|
if (krberr) {
|
||||||
|
slapi_ch_free_string(&serviceName);
|
||||||
|
slapi_log_error(SLAPI_LOG_FATAL, "ipa_pwd_extop", "krb5_unparse_name failed\n");
|
||||||
|
rc = LDAP_OPERATIONS_ERROR;
|
||||||
|
goto free_and_return;
|
||||||
|
}
|
||||||
|
slapi_ch_free_string(&serviceName);
|
||||||
|
serviceName = canonname;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check entry before doing any other decoding */
|
/* check entry before doing any other decoding */
|
||||||
|
|
||||||
|
|
||||||
/* Find ancestor base DN */
|
/* Find ancestor base DN */
|
||||||
sdn = slapi_sdn_new_dn_byval(ipa_realm_dn);
|
sdn = slapi_sdn_new_dn_byval(ipa_realm_dn);
|
||||||
be = slapi_be_select(sdn);
|
be = slapi_be_select(sdn);
|
||||||
@ -2450,7 +2463,7 @@ static int ipapwd_setkeytab(Slapi_PBlock *pb)
|
|||||||
|
|
||||||
/* Free anything that we allocated above */
|
/* Free anything that we allocated above */
|
||||||
free_and_return:
|
free_and_return:
|
||||||
slapi_ch_free_string(&serviceName);
|
if (serviceName) free(serviceName);
|
||||||
if (kset) ipapwd_keyset_free(&kset);
|
if (kset) ipapwd_keyset_free(&kset);
|
||||||
|
|
||||||
if (bval) ber_bvfree(bval);
|
if (bval) ber_bvfree(bval);
|
||||||
|
Loading…
Reference in New Issue
Block a user