Blame SOURCES/quota-4.04-quotacheck-Fail-check-if-quota-file-magic-is-invalid.patch

30c500
From b9525abadba082073e20e54ee7ad2423fc1ae6a8 Mon Sep 17 00:00:00 2001
30c500
From: Jan Kara <jack@suse.cz>
30c500
Date: Mon, 5 Feb 2018 16:27:59 +0100
30c500
Subject: [PATCH] quotacheck: Fail check if quota file magic is invalid
30c500
MIME-Version: 1.0
30c500
Content-Type: text/plain; charset=UTF-8
30c500
Content-Transfer-Encoding: 8bit
30c500
30c500
Currently quotacheck will just continue if quotafile magic is invalid.
30c500
Instead ask whether we should continue assuming quota format passed from
30c500
the command line.
30c500
30c500
Signed-off-by: Jan Kara <jack@suse.cz>
30c500
Signed-off-by: Petr Písař <ppisar@redhat.com>
30c500
---
30c500
 quotacheck_v2.c | 3 +++
30c500
 1 file changed, 3 insertions(+)
30c500
30c500
diff --git a/quotacheck_v2.c b/quotacheck_v2.c
30c500
index 86fbf42..465765b 100644
30c500
--- a/quotacheck_v2.c
30c500
+++ b/quotacheck_v2.c
30c500
@@ -357,6 +357,9 @@ static int check_header(char *filename, int fd, int type, int version)
30c500
 	    le32toh(head.dqh_version) > known_versions[type]) {
30c500
 		errstr(_("WARNING - Quota file %s has corrupted headers\n"),
30c500
 			filename);
30c500
+		if (!(flags & FL_INTERACTIVE) ||
30c500
+		    !ask_yn(_("Continue checking assuming format from command line?"), 0))
30c500
+			return -1;
30c500
 	}
30c500
 	if (le32toh(head.dqh_version) != version) {
30c500
 		errstr(_("Quota file format version %d does not match the one "
30c500
-- 
30c500
2.13.6
30c500