From: Richard Basch Date: Fri, 9 Feb 1996 00:50:32 +0000 (+0000) Subject: * fcc_maybe.c X-Git-Tag: krb5-1.0-beta6~522 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b345adf741381a01adc07c63013c0fe36866a16b;p=krb5.git * fcc_maybe.c Only store the os_context time offset if it is valid. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7462 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/ccache/file/fcc_maybe.c b/src/lib/krb5/ccache/file/fcc_maybe.c index 5ce020d17..257c06e84 100644 --- a/src/lib/krb5/ccache/file/fcc_maybe.c +++ b/src/lib/krb5/ccache/file/fcc_maybe.c @@ -271,24 +271,29 @@ krb5_fcc_open_file (context, id, mode) if (data->version == KRB5_FCC_FVNO_4) { /* V4 of the credentials cache format allows for header tags */ - fcc_flen = (2*sizeof(krb5_ui_2) + 2*sizeof(krb5_int32)); + fcc_flen = 0; + + if (os_ctx->os_flags & KRB5_OS_TOFFSET_VALID) + fcc_flen += (2*sizeof(krb5_ui_2) + 2*sizeof(krb5_int32)); /* Write header length */ retval = krb5_fcc_store_ui_2(context, id, (krb5_int32)fcc_flen); if (retval) goto done; - /* Write time offset tag */ - fcc_tag = FCC_TAG_DELTATIME; - fcc_taglen = 2*sizeof(krb5_int32); - - retval = krb5_fcc_store_ui_2(context, id, (krb5_int32)fcc_tag); - if (retval) goto done; - retval = krb5_fcc_store_ui_2(context, id, (krb5_int32)fcc_taglen); - if (retval) goto done; - retval = krb5_fcc_store_int32(context, id, os_ctx->time_offset); - if (retval) goto done; - retval = krb5_fcc_store_int32(context, id, os_ctx->usec_offset); - if (retval) goto done; + if (os_ctx->os_flags & KRB5_OS_TOFFSET_VALID) { + /* Write time offset tag */ + fcc_tag = FCC_TAG_DELTATIME; + fcc_taglen = 2*sizeof(krb5_int32); + + retval = krb5_fcc_store_ui_2(context,id,(krb5_int32)fcc_tag); + if (retval) goto done; + retval = krb5_fcc_store_ui_2(context,id,(krb5_int32)fcc_taglen); + if (retval) goto done; + retval = krb5_fcc_store_int32(context,id,os_ctx->time_offset); + if (retval) goto done; + retval = krb5_fcc_store_int32(context,id,os_ctx->usec_offset); + if (retval) goto done; + } } goto done; }