From: Sam Hartman Date: Fri, 26 Jan 1996 05:22:37 +0000 (+0000) Subject: Convert the kvno to a char before writing it out. (The previous code X-Git-Tag: krb5-1.0-beta6~562 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b07930839186fbc7d8c8c822d19ac4004fb59bc1;p=krb5.git Convert the kvno to a char before writing it out. (The previous code tried, but casting from (int *) to (char *) is not the same as casting from int to char. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7390 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/ktutil/ChangeLog b/src/kadmin/ktutil/ChangeLog index a83c9d580..6bc63eb7a 100644 --- a/src/kadmin/ktutil/ChangeLog +++ b/src/kadmin/ktutil/ChangeLog @@ -1,3 +1,8 @@ +Fri Jan 26 00:06:50 1996 Sam Hartman + + * ktutil_funcs.c (ktutil_write_srvtab): Write v4 version + properly. Previous code was endien dependent. + Mon Dec 25 10:03:15 1995 Ezra Peisach * ktutil.c (ktutil_write_v4): Call ktutil_write_srvtab not diff --git a/src/kadmin/ktutil/ktutil_funcs.c b/src/kadmin/ktutil/ktutil_funcs.c index a5bb06bb1..bad66bdc7 100644 --- a/src/kadmin/ktutil/ktutil_funcs.c +++ b/src/kadmin/ktutil/ktutil_funcs.c @@ -1,7 +1,7 @@ /* * kadmin/ktutil/ktutil_funcs.c * - * Copyright 1995 by the Massachusetts Institute of Technology. + *(C) Copyright 1995, 1996 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may @@ -356,6 +356,8 @@ krb5_error_code ktutil_write_srvtab(context, list, name) goto free_pruned; } for (lp = pruned; lp; lp = lp->next) { + unsigned char kvno; + kvno = (unsigned char) lp->entry->vno; retval = krb5_524_conv_principal(context, lp->entry->principal, sname, sinst, srealm); @@ -364,7 +366,7 @@ krb5_error_code ktutil_write_srvtab(context, list, name) fwrite(sname, strlen(sname) + 1, 1, fp); fwrite(sinst, strlen(sinst) + 1, 1, fp); fwrite(srealm, strlen(srealm) + 1, 1, fp); - fwrite((char *)&lp->entry->vno, 1, 1, fp); + fwrite((char *)&kvno, 1, 1, fp); fwrite((char *)lp->entry->key.contents, sizeof (des_cblock), 1, fp); }