use local creds to avoid bashing
authorJohn Kohl <jtkohl@mit.edu>
Mon, 7 May 1990 17:14:08 +0000 (17:14 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Mon, 7 May 1990 17:14:08 +0000 (17:14 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@765 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/ccache/file/fcc_retrv.c

index 14ba144de1b59d4bf63c1f24462c978f68e99fd2..6107f660e430f32dd65f5284d7ff34a3de4667f6 100644 (file)
@@ -59,30 +59,32 @@ krb5_fcc_retrieve(id, whichfields, mcreds, creds)
 
      krb5_cc_cursor cursor;
      krb5_error_code kret;
+     krb5_creds fetchcreds;
 
      kret = krb5_fcc_start_seq_get(id, &cursor);
      if (kret != KRB5_OK)
          return kret;
 
-     while ((kret = krb5_fcc_next_cred(id, &cursor, creds)) == KRB5_OK) {
-         if (standard_fields_match(mcreds, creds)
+     while ((kret = krb5_fcc_next_cred(id, &cursor, &fetchcreds)) == KRB5_OK) {
+         if (standard_fields_match(mcreds, &fetchcreds)
              &&
              (! set(KRB5_TC_MATCH_IS_SKEY) ||
-              mcreds->is_skey == creds->is_skey)
+              mcreds->is_skey == fetchcreds.is_skey)
              &&
              (! set(KRB5_TC_MATCH_FLAGS_EXACT) ||
-              mcreds->ticket_flags == creds->ticket_flags)
+              mcreds->ticket_flags == fetchcreds.ticket_flags)
              &&
              (! set(KRB5_TC_MATCH_FLAGS) ||
-              flags_match(mcreds->ticket_flags, creds->ticket_flags))
+              flags_match(mcreds->ticket_flags, fetchcreds.ticket_flags))
              &&
              (! set(KRB5_TC_MATCH_TIMES_EXACT) ||
-              times_match_exact(&mcreds->times, &creds->times))
+              times_match_exact(&mcreds->times, &fetchcreds.times))
              &&
              (! set(KRB5_TC_MATCH_TIMES) ||
-              times_match(&mcreds->times, &creds->times)))
+              times_match(&mcreds->times, &fetchcreds.times)))
          {
               krb5_fcc_end_seq_get(id, &cursor);
+              *creds = fetchcreds;
               return KRB5_OK;
          }