From cd4ae93ee7da134f2fed92aec5e51147ac8cdad6 Mon Sep 17 00:00:00 2001 From: Petr Písař Date: Feb 05 2018 16:36:34 +0000 Subject: Report an error if quota file magic is invalid --- diff --git a/quota-4.04-quotacheck-Fail-check-if-quota-file-magic-is-invalid.patch b/quota-4.04-quotacheck-Fail-check-if-quota-file-magic-is-invalid.patch new file mode 100644 index 0000000..8d99cec --- /dev/null +++ b/quota-4.04-quotacheck-Fail-check-if-quota-file-magic-is-invalid.patch @@ -0,0 +1,35 @@ +From b9525abadba082073e20e54ee7ad2423fc1ae6a8 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Mon, 5 Feb 2018 16:27:59 +0100 +Subject: [PATCH] quotacheck: Fail check if quota file magic is invalid +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Currently quotacheck will just continue if quotafile magic is invalid. +Instead ask whether we should continue assuming quota format passed from +the command line. + +Signed-off-by: Jan Kara +Signed-off-by: Petr Písař +--- + quotacheck_v2.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/quotacheck_v2.c b/quotacheck_v2.c +index 86fbf42..465765b 100644 +--- a/quotacheck_v2.c ++++ b/quotacheck_v2.c +@@ -357,6 +357,9 @@ static int check_header(char *filename, int fd, int type, int version) + le32toh(head.dqh_version) > known_versions[type]) { + errstr(_("WARNING - Quota file %s has corrupted headers\n"), + filename); ++ if (!(flags & FL_INTERACTIVE) || ++ !ask_yn(_("Continue checking assuming format from command line?"), 0)) ++ return -1; + } + if (le32toh(head.dqh_version) != version) { + errstr(_("Quota file format version %d does not match the one " +-- +2.13.6 + diff --git a/quota.spec b/quota.spec index 0e78983..fc1fad5 100644 --- a/quota.spec +++ b/quota.spec @@ -71,6 +71,8 @@ Patch7: quota-4.04-quotacheck-Avoid-question-in-non-interactive-mode.patch # Report an error when quotacheck fails to cache quota files, # in upstream after 4.04 Patch8: quota-4.04-quotacheck-Report-error-when-caching-of-quota-file-f.patch +# Report an error if quota file magic is invalid, in upstream after 4.04 +Patch9: quota-4.04-quotacheck-Fail-check-if-quota-file-magic-is-invalid.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: bash @@ -193,6 +195,7 @@ Linux/UNIX environment. %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 # Regenerate build scripts autoreconf -f -i @@ -340,6 +343,7 @@ make check * Mon Feb 05 2018 Petr Pisar - 1:4.04-4 - Avoid questions in quotacheck non-interactive mode - Report an error when quotacheck fails to cache quota files +- Report an error if quota file magic is invalid * Mon Feb 05 2018 Petr Pisar - 1:4.04-3 - rpcgen tool split from glibc-common package