mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
aklog-old-principal-conversion-sans-524-20090315
LICENSE IPL10 we'll want to fix this differently later; since 524 is dying perhaps we need to just ship heimdal's version of this code
This commit is contained in:
parent
d0e4044cfe
commit
fd9e5ffb46
@ -633,6 +633,7 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm)
|
|||||||
if (dflag)
|
if (dflag)
|
||||||
printf("Using Kerberos V5 ticket natively\n");
|
printf("Using Kerberos V5 ticket natively\n");
|
||||||
|
|
||||||
|
#ifndef HAVE_NO_KRB5_524
|
||||||
status = krb5_524_conv_principal (context, v5cred->client, &k4name, &k4inst, &k4realm);
|
status = krb5_524_conv_principal (context, v5cred->client, &k4name, &k4inst, &k4realm);
|
||||||
if (status) {
|
if (status) {
|
||||||
afs_com_err(progname, status, "while converting principal "
|
afs_com_err(progname, status, "while converting principal "
|
||||||
@ -644,6 +645,22 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm)
|
|||||||
strcat (username, ".");
|
strcat (username, ".");
|
||||||
strcat (username, k4inst);
|
strcat (username, k4inst);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
len = min(get_princ_len(context, v5cred->client, 0),
|
||||||
|
second_comp(context, v5cred->client) ?
|
||||||
|
MAXKTCNAMELEN - 2 : MAXKTCNAMELEN - 1);
|
||||||
|
strncpy(username, get_princ_str(context, v5cred->client, 0), len);
|
||||||
|
username[len] = '\0';
|
||||||
|
|
||||||
|
if (second_comp(context, v5cred->client)) {
|
||||||
|
strcat(username, ".");
|
||||||
|
p = username + strlen(username);
|
||||||
|
len = min(get_princ_len(context, v5cred->client, 1),
|
||||||
|
MAXKTCNAMELEN - strlen(username) - 1);
|
||||||
|
strncpy(p, get_princ_str(context, v5cred->client, 1), len);
|
||||||
|
p[len] = '\0';
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
memset(&atoken, 0, sizeof(atoken));
|
memset(&atoken, 0, sizeof(atoken));
|
||||||
atoken.kvno = RXKAD_TKT_TYPE_KERBEROS_V5;
|
atoken.kvno = RXKAD_TKT_TYPE_KERBEROS_V5;
|
||||||
|
Loading…
Reference in New Issue
Block a user