]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fsck.cramfs: allow smaller superblock sizes
authorRuediger Meier <ruediger.meier@ga-group.nl>
Sun, 18 May 2014 22:43:53 +0000 (00:43 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Mon, 19 May 2014 07:19:29 +0000 (09:19 +0200)
We are already fine with checking for different endianess. Now we
also succeed if systems's page size does not match.

Note that page_size is only really used if INCLUDE_FS_TESTS is
defined, see followups.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
disk-utils/fsck.cramfs.c

index 66523f4decbab43c9b31f5a98343831ec1836720..00ea2ab569336a03ea624b50e30ea2c2a9913ca9 100644 (file)
@@ -189,7 +189,8 @@ static void test_super(int *start, size_t * length)
        if (super.flags & ~CRAMFS_SUPPORTED_FLAGS)
                errx(FSCK_EX_ERROR, _("unsupported filesystem features"));
 
-       if (super.size < page_size)
+       /* What are valid superblock sizes? */
+       if (super.size < sizeof(struct cramfs_super))
                errx(FSCK_EX_UNCORRECTED, _("superblock size (%d) too small"),
                     super.size);