diff options
author | Jan Kara <jack@suse.cz> | 2018-02-05 16:27:59 +0100 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2018-02-05 16:27:59 +0100 |
commit | b9525abadba082073e20e54ee7ad2423fc1ae6a8 (patch) | |
tree | 1e20ff2160426cb26bb1dc28e54b1ce96d3fac82 | |
parent | 7b6dfd6390476ec7b811c76e4e2653db2994cad4 (diff) | |
download | quota-tools-b9525abadba082073e20e54ee7ad2423fc1ae6a8.tar.gz |
quotacheck: Fail check if quota file magic is invalid
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 <jack@suse.cz>
-rw-r--r-- | quotacheck_v2.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 " |