From d913447cbdfe73bf3155376807fe3f106ab2ddde Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Fri, 7 May 2004 19:18:17 +0000 Subject: [PATCH] Patch from Matt Crawford to allow matching on realm in cross-realm authentication for krb5_aname_to_lname. Ticket: 957 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16321 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/ChangeLog | 5 +++++ src/lib/krb5/os/an_to_ln.c | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 431bbd475..59c24dc0d 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,8 @@ +2004-05-07 Sam Hartman + + * an_to_ln.c: Patch from Matt Crawford to allow matching on + realms of cross-realm principals. + 2004-05-05 Ken Raeburn * localaddr.c: Incorporate foreach_localaddr implementation. diff --git a/src/lib/krb5/os/an_to_ln.c b/src/lib/krb5/os/an_to_ln.c index c42b82142..41a5bde31 100644 --- a/src/lib/krb5/os/an_to_ln.c +++ b/src/lib/krb5/os/an_to_ln.c @@ -460,7 +460,7 @@ rule_an_to_ln(krb5_context context, char *rule, krb5_const_principal aname, cons char *selstring = 0; int num_comps, compind; char *cout; - krb5_data *datap; + krb5_const krb5_data *datap; char *outstring; /* @@ -493,9 +493,11 @@ rule_an_to_ln(krb5_context context, char *rule, krb5_const_principal aname, cons if (*current == '$') { if ((sscanf(current+1, "%d", &compind) == 1) && (compind <= num_comps) && - (datap = krb5_princ_component(context, - aname, - compind-1)) + (datap = + (compind > 0) + ? krb5_princ_component(context, aname, + compind-1) + : krb5_princ_realm(context, aname)) ) { strncpy(cout, datap->data, -- 2.26.2