From 12a40b3442800468977a3fe08bf47c29448bdbd3 Mon Sep 17 00:00:00 2001 From: Barry Jaspan Date: Tue, 5 Nov 1996 21:17:45 +0000 Subject: [PATCH] minor fix to verification of specified load version (autodetect code already worked properly) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9298 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/dbutil/ChangeLog | 5 +++++ src/kadmin/dbutil/dump.c | 12 ++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/kadmin/dbutil/ChangeLog b/src/kadmin/dbutil/ChangeLog index 3f8d54f2e..5fd3e11cf 100644 --- a/src/kadmin/dbutil/ChangeLog +++ b/src/kadmin/dbutil/ChangeLog @@ -1,3 +1,8 @@ +Tue Nov 5 16:16:53 1996 Barry Jaspan + + * dump.c (load_db): minor fix to code that verifies the specified + load version matches the file (autodetect worked anyway) + Fri Oct 18 14:23:41 1996 Barry Jaspan * dump.c (load_db): osa_adb_rename_policy_db will create the db, diff --git a/src/kadmin/dbutil/dump.c b/src/kadmin/dbutil/dump.c index 6d82222c6..6f9b4b7d7 100644 --- a/src/kadmin/dbutil/dump.c +++ b/src/kadmin/dbutil/dump.c @@ -1976,12 +1976,8 @@ load_db(argc, argv) */ fgets(buf, sizeof(buf), f); if (load) { - /* - * If the header does not end in newline, only check what we know. - */ - if ((load->header[strlen(load->header)-1] != '\n' && - strncmp(buf, load->header, strlen(load->header)) != 0) || - (strcmp(buf, load->header) != 0)) { + /* only check what we know; some headers only contain a prefix */ + if (strncmp(buf, load->header, strlen(load->header)) != 0) { fprintf(stderr, head_bad_fmt, programname, dumpfile); exit_status++; if (dumpfile) fclose(f); @@ -2006,8 +2002,8 @@ load_db(argc, argv) } } if (load->updateonly && !update) { - fprintf(stderr, "%s: dump version %s can only be loaded in " - "update mode\n", programname, load->name); + fprintf(stderr, "%s: dump version %s can only be loaded with the " + "-update flag\n", programname, load->name); exit_status++; return; } -- 2.26.2