OSDN Git Service

Enforce inherent limitations of dos and dvh partition table formats.
authorJim Meyering <meyering@redhat.com>
Thu, 10 Jan 2008 13:51:56 +0000 (14:51 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 4 Feb 2008 07:21:49 +0000 (08:21 +0100)
commit71bbe2995371357c534dccf1eb3d436b399eaf32
tree9da52c00ca2418dc1eff3586ca229ddde593c89a
parentf564981d2e5f4d5daad5a6f704dfa22ffaa9cf94
Enforce inherent limitations of dos and dvh partition table formats.

* libparted/disk.c (_check_partition): Enforce the 32-bit limitation
on a partition's starting sector number and length (in sectors).
With the usual 512-byte sector size, this limits the maximum
partition size to just under 2TB.
(_partition_max_start, _partition_max_len): New functions.
(_check_partition): Use them.
* tests/t4100-msdos-partition-limits.sh: New file.  Test vs. msdos.
* tests/t4100-dvh-partition-limits.sh: New file.  Test vs. dvh.
* tests/Makefile.am (TESTS): Add t4100-msdos-partition-limits.sh
and t4100-dvh-partition-limits.sh.
libparted/disk.c
tests/Makefile.am
tests/t4100-dvh-partition-limits.sh [new file with mode: 0755]
tests/t4100-msdos-partition-limits.sh [new file with mode: 0755]