From: Theodore Tso Date: Thu, 11 Jan 1996 04:05:22 +0000 (+0000) Subject: fcc.h (KRB5_FCC_DEFAULT_VNO): Remove KRB5_FCC_DEFAULT_VNO; now set in X-Git-Tag: krb5-1.0-beta6~633 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ef24891c5c9dd2d7a1b3a828fcc3cf34fd5b8f0d;p=krb5.git fcc.h (KRB5_FCC_DEFAULT_VNO): Remove KRB5_FCC_DEFAULT_VNO; now set in init_ctx.c. fcc_maybe.c (krb5_fcc_open_file): fcc_gennew.c (krb5_fcc_generate_new): Use context->fcc_default_format to determine the credentials cache type. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7301 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/ccache/file/ChangeLog b/src/lib/krb5/ccache/file/ChangeLog index 43b2976df..d9634a711 100644 --- a/src/lib/krb5/ccache/file/ChangeLog +++ b/src/lib/krb5/ccache/file/ChangeLog @@ -1,5 +1,13 @@ Wed Jan 10 21:14:31 1996 Theodore Y. Ts'o + * fcc.h (KRB5_FCC_DEFAULT_VNO): Remove KRB5_FCC_DEFAULT_VNO; now + set in init_ctx.c. + + * fcc_maybe.c (krb5_fcc_open_file): + * fcc_gennew.c (krb5_fcc_generate_new): Use + context->fcc_default_format to determine the credentials + cache type. + * fcc_read.c (krb5_fcc_read_keyblock): If reading in a version 3 credentials cache, ignore the second enctype stored in the ccache; just read it into a dummy variable. diff --git a/src/lib/krb5/ccache/file/fcc.h b/src/lib/krb5/ccache/file/fcc.h index 0e26fa7f6..bd3f8c368 100644 --- a/src/lib/krb5/ccache/file/fcc.h +++ b/src/lib/krb5/ccache/file/fcc.h @@ -47,9 +47,9 @@ * The code will accept version 1, 2, and 3 ccaches, and depending * what KRB5_FCC_DEFAULT_FVNO is set to, it will create version 1, 2, * or 3 FCC caches. - * - * KRB5_FCC_DEFAULT_FVNO should be set to version 3, unless there is - * some overriding compatibility reasons not to do so. + * + * The default credentials cache should be type 3 for now (see + * init_ctx.c). */ #define KRB5_FCC_FVNO_1 0x0501 /* krb5 v5, fcc v1 */ @@ -57,8 +57,6 @@ #define KRB5_FCC_FVNO_3 0x0503 /* krb5 v5, fcc v3 */ #define KRB5_FCC_FVNO_4 0x0504 /* krb5 v5, fcc v4 */ -#define KRB5_FCC_DEFAULT_FVNO KRB5_FCC_FVNO_3 - #define FCC_OPEN_AND_ERASE 1 #define FCC_OPEN_RDWR 2 #define FCC_OPEN_RDONLY 3 diff --git a/src/lib/krb5/ccache/file/fcc_gennew.c b/src/lib/krb5/ccache/file/fcc_gennew.c index 93d963b15..177e0e960 100644 --- a/src/lib/krb5/ccache/file/fcc_gennew.c +++ b/src/lib/krb5/ccache/file/fcc_gennew.c @@ -106,7 +106,7 @@ krb5_fcc_generate_new (context, id) retcode = krb5_fcc_interpret(context, errno); goto err_out; } else { - krb5_int16 fcc_fvno = htons(KRB5_FCC_DEFAULT_FVNO); + krb5_int16 fcc_fvno = htons(context->fcc_default_format); krb5_int16 fcc_flen = 0; int errsave, cnt; @@ -127,7 +127,7 @@ krb5_fcc_generate_new (context, id) goto err_out; } /* For version 4 we save a length for the rest of the header */ - if (KRB5_FCC_DEFAULT_FVNO == KRB5_FCC_FVNO_4) { + if (context->fcc_default_format == KRB5_FCC_FVNO_4) { if ((cnt = write(ret, (char *)&fcc_flen, sizeof(fcc_flen))) != sizeof(fcc_flen)) { errsave = errno; diff --git a/src/lib/krb5/ccache/file/fcc_maybe.c b/src/lib/krb5/ccache/file/fcc_maybe.c index 2071c681e..2b4961e95 100644 --- a/src/lib/krb5/ccache/file/fcc_maybe.c +++ b/src/lib/krb5/ccache/file/fcc_maybe.c @@ -34,8 +34,6 @@ #include "fcc.h" -int krb5_fcc_default_format = KRB5_FCC_DEFAULT_FVNO; - #ifdef KRB5_USE_INET #if !defined(_WINSOCKAPI_) && !defined(HAVE_MACSOCK_H) #include @@ -254,8 +252,8 @@ krb5_fcc_open_file (context, id, mode) /* write the version number */ int errsave, cnt; - fcc_fvno = htons(krb5_fcc_default_format); - data->version = krb5_fcc_default_format; + fcc_fvno = htons(context->fcc_default_format); + data->version = context->fcc_default_format; if ((cnt = write(fd, (char *)&fcc_fvno, sizeof(fcc_fvno))) != sizeof(fcc_fvno)) { errsave = errno;