diff options
author | Ben Kaduk <kaduk@mit.edu> | 2015-03-06 15:42:10 -0500 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2015-05-13 16:51:32 -0400 |
commit | 5761b5f169933fab63a4ec6ba2eecef88d84fd34 (patch) | |
tree | 8e8fad682bebe9c2ce6bd9d413cb60e95885f45e | |
parent | 94c9678dfb87d68a3d6ca25def5e6b415a7d0553 (diff) | |
download | krb5-5761b5f169933fab63a4ec6ba2eecef88d84fd34.zip krb5-5761b5f169933fab63a4ec6ba2eecef88d84fd34.tar.gz krb5-5761b5f169933fab63a4ec6ba2eecef88d84fd34.tar.bz2 |
Fix loop to determine MSLSA principal name
When looping over principals, check the i-th entry instead of
looking at the 0-th entry each time through the loop. This would
only affect cases when multiple ticket entries were returned from
the LSA, the first one did not have a valid principal name, but
some other one did. It is expected that all of the returned
ticket entries will always have a valid client principal name, so
this is unlikely to cause any functional difference.
(cherry picked from commit d7dc6c347e352324e374b3456f60e49aa4b8ba08)
ticket: 8177
version_fixed: 1.13.3
status: resolved
-rw-r--r-- | src/lib/krb5/ccache/cc_mslsa.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/krb5/ccache/cc_mslsa.c b/src/lib/krb5/ccache/cc_mslsa.c index c775805..7a80470 100644 --- a/src/lib/krb5/ccache/cc_mslsa.c +++ b/src/lib/krb5/ccache/cc_mslsa.c @@ -1568,8 +1568,8 @@ krb5_lcc_resolve (krb5_context context, krb5_ccache *id, const char *residual) /* Take the first client principal we find; they should all be the * same anyway. */ for (i = 0; i < pResponse->CountOfTickets; i++) { - if (UnicodeStringToMITPrinc(&pResponse->Tickets[0].ClientName, - &pResponse->Tickets[0].ClientRealm, + if (UnicodeStringToMITPrinc(&pResponse->Tickets[i].ClientName, + &pResponse->Tickets[i].ClientRealm, context, &data->princ)) break; @@ -1915,8 +1915,8 @@ krb5_lcc_get_principal(krb5_context context, krb5_ccache id, krb5_principal *pri /* Take the first client principal we find; they should all be the * same anyway. */ for (i = 0; i < pResponse->CountOfTickets; i++) { - if (UnicodeStringToMITPrinc(&pResponse->Tickets[0].ClientName, - &pResponse->Tickets[0].ClientRealm, + if (UnicodeStringToMITPrinc(&pResponse->Tickets[i].ClientName, + &pResponse->Tickets[i].ClientRealm, context, &data->princ)) break; } |