]> err.no Git - util-linux/commitdiff
mkswap: don't use too small user-specified page size
authorKarel Zak <kzak@redhat.com>
Thu, 17 Jun 2010 08:57:47 +0000 (10:57 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 17 Jun 2010 08:57:47 +0000 (10:57 +0200)
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=601552
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/mkswap.c

index 25a920ad57043a33c94292e7ed615d79e02c6a28..9337807650d1323c991add96ccb0a9fcf64b2da2 100644 (file)
@@ -153,7 +153,7 @@ init_signature_page(void) {
 
        if (user_pagesize) {
                if ((user_pagesize & (user_pagesize-1)) ||
-                   user_pagesize < 1024) {
+                   user_pagesize < sizeof(struct swap_header_v1_2) + 10) {
                        fprintf(stderr, _("Bad user-specified page size %d\n"),
                                user_pagesize);
                        exit(1);