]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: test return from krb5_cc_start_seq_get
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 16 May 2011 01:51:14 +0000 (21:51 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Wed, 18 May 2011 17:56:50 +0000 (10:56 -0700)
If krb5_cc_start_get fails when using Heimdal, the cursor
is invalid and it is not safe to pass it into subsequent
functions.

Change-Id: I2218d8824af0e35392457b960f11bef970072638
Reviewed-on: http://gerrit.openafs.org/4658
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-on: http://gerrit.openafs.org/4673

src/WINNT/afsd/afskfw.c

index 0d950879e3330be67b213ee3cfbdb30164744a9d..ec6f3b3655617833e19333bf6bc63ca9d99aafde 100644 (file)
@@ -770,6 +770,7 @@ KFW_AFS_update_princ_ccache_data(krb5_context ctx, krb5_ccache cc, int lsa)
     code = pkrb5_timeofday(ctx, &now);
 
     cc_code = pkrb5_cc_start_seq_get(ctx, cc, &cur);
+    if (cc_code) goto cleanup;
 
     while (!(cc_code = pkrb5_cc_next_cred(ctx, cc, &cur, &creds))) {
         if ( creds.ticket_flags & TKT_FLG_INITIAL ) {
@@ -1233,6 +1234,7 @@ KFW_import_ccache_data(void)
         KFW_AFS_update_princ_ccache_data(ctx, cc, !strcmp(pNCi[i]->name,LSA_CCNAME));
 
         cc_code = pkrb5_cc_start_seq_get(ctx, cc, &cur);
+        if (cc_code) goto cleanup;
 
         while (!(cc_code = pkrb5_cc_next_cred(ctx, cc, &cur, &creds))) {
             krb5_data * sname = krb5_princ_name(ctx, creds.server);