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

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