[1661] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

Re: probs with v4 backwards compat in 5b5

daemon@ATHENA.MIT.EDU (epeisach@MIT.EDU)
Mon Oct 9 16:41:44 1995

From: epeisach@MIT.EDU
Date: Mon, 9 Oct 1995 16:41:29 -0400
To: vladimir@interpdi.com
Cc: krb5-bugs@MIT.EDU
In-Reply-To: [1659]


A similar problem was reported by Derek Atkins which I am now
integrating into the source tree. The following is his message. 
I will check his sources into the tree after making the few
modifications needed as the source tree has wandered.
He is correct - the version number is only one byte long, not four. 

	Ezra

>Subject: krb5_edit prints bad v4 srvtabs
>Date: Thu, 7 Sep 1995 19:23:35 -0700
>From: Derek Atkins <warlord@Eng.Sun.COM>
>To: krb5-bugs@MIT.EDU

>The krb5_edit in the beta 5.5 snapshot prints incorrect v4 srvtabs.
>Here is a patch to kdb5_edit.c to fix the problem.  It was outputting
>a kvno of 4 bytes, when v4 srvtab only uses a single byte.

>-derek


------- kdb5_edit.c -------
*** /tmp/da003n2        Wed Dec 31 16:00:00 1969
--- src/admin/edit/kdb5_edit.c  Thu Sep  7 19:16:27 1995
***************
*** 825,830 ****
--- 825,832 ----
        return;
      }
      for (i = 2; i < argc; i++) {
+       unsigned char kvno;
+
        /* iterate over the names */
        pname = malloc(strlen(argv[1])+strlen(argv[i])+strlen(cur_realm)+3);
        if (!pname) {
***************
*** 883,889 ****
        fwrite(argv[i], strlen(argv[i]) + 1, 1, fout); /* p.name */
        fwrite(argv[1], strlen(argv[1]) + 1, 1, fout); /* p.instance */
        fwrite(cur_realm, strlen(cur_realm) + 1, 1, fout); /* p.realm */
!       fwrite((char *)&dbentry.kvno, sizeof(dbentry.kvno), 1, fout);
        fwrite((char *)key.contents, 8, 1, fout);
        printf("'%s' added to V4 srvtab '%s'\n", pname, ktname);
        memset((char *)key.contents, 0, key.length);
--- 885,892 ----
        fwrite(argv[i], strlen(argv[i]) + 1, 1, fout); /* p.name */
        fwrite(argv[1], strlen(argv[1]) + 1, 1, fout); /* p.instance */
        fwrite(cur_realm, strlen(cur_realm) + 1, 1, fout); /* p.realm */
!       kvno = (unsigned char) dbentry.kvno;
!       fwrite((char *)&kvno, sizeof(kvno), 1, fout);
        fwrite((char *)key.contents, 8, 1, fout);
        printf("'%s' added to V4 srvtab '%s'\n", pname, ktname);
        memset((char *)key.contents, 0, key.length);

home help back first fref pref prev next nref lref last post