From e0f2db0a4c9a38dce3b91186616178bb71b64a18 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Mon, 9 Oct 1995 22:55:41 +0000 Subject: [PATCH] extract_v4_srvtab: Version number is only one byte long (warlord) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6950 dc483132-0cff-0310-8789-dd5450dbe970 --- src/admin/edit/ChangeLog | 5 +++++ src/admin/edit/kdb5_edit.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/admin/edit/ChangeLog b/src/admin/edit/ChangeLog index 774762ef5..f4fd66f04 100644 --- a/src/admin/edit/ChangeLog +++ b/src/admin/edit/ChangeLog @@ -1,3 +1,8 @@ +Mon Oct 9 16:35:19 1995 Ezra Peisach + + * kdb5_edit.c (extract_v4_srvtab): Extract a one byte version + number for v4 srvtabs (from warlord). + Thu Oct 5 10:35:35 1995 Ezra Peisach * cpw.c: Declare std_ks_tuple as extern. diff --git a/src/admin/edit/kdb5_edit.c b/src/admin/edit/kdb5_edit.c index d531ba235..3d80a9c2b 100644 --- a/src/admin/edit/kdb5_edit.c +++ b/src/admin/edit/kdb5_edit.c @@ -767,6 +767,8 @@ void extract_v4_srvtab(argc, argv) 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) { @@ -826,8 +828,8 @@ void extract_v4_srvtab(argc, argv) 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.key_data[0].key_data_kvno, - sizeof(dbentry.key_data[0].key_data_kvno), 1, fout); + kvno = (unsigned char) dbentry.key_data[0].key_data_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); -- 2.26.2