Blame SOURCES/quota-4.04-quotacheck-Avoid-question-in-non-interactive-mode.patch

30c500
From 4179911dc38af1b6499704a7f7fb710a40c95bdb Mon Sep 17 00:00:00 2001
30c500
From: Jan Kara <jack@suse.cz>
30c500
Date: Mon, 5 Feb 2018 15:39:12 +0100
30c500
Subject: [PATCH] quotacheck: Avoid question in non-interactive mode
30c500
MIME-Version: 1.0
30c500
Content-Type: text/plain; charset=UTF-8
30c500
Content-Transfer-Encoding: 8bit
30c500
30c500
A question when quota file version is incorrect is asked even if
30c500
quotacheck is run in non-interactive mode. Avoid asking the question in
30c500
that case and fail the check instead.
30c500
30c500
Reproted-by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
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, 2 insertions(+), 1 deletion(-)
30c500
30c500
diff --git a/quotacheck_v2.c b/quotacheck_v2.c
30c500
index 4cc8558..86fbf42 100644
30c500
--- a/quotacheck_v2.c
30c500
+++ b/quotacheck_v2.c
30c500
@@ -363,7 +363,8 @@ static int check_header(char *filename, int fd, int type, int version)
30c500
 			 "specified on command line (%d). Quota file header "
30c500
 			 "may be corrupted.\n"),
30c500
 		       le32toh(head.dqh_version), version);
30c500
-		if (!ask_yn(_("Continue checking assuming version from command line?"), 1))
30c500
+		if (!(flags & FL_INTERACTIVE) ||
30c500
+		    !ask_yn(_("Continue checking assuming version from command line?"), 1))
30c500
 			return -1;
30c500
 		detected_versions[type] = version;
30c500
 	} else
30c500
-- 
30c500
2.13.6
30c500