OSDN Git Service

libparted: enforce dos partition limit
authorPhillip Susi <psusi@cfl.rr.com>
Fri, 13 Jan 2012 21:21:51 +0000 (16:21 -0500)
committerJim Meyering <meyering@redhat.com>
Wed, 18 Jan 2012 13:11:57 +0000 (14:11 +0100)
commitb4351c7b7205afb6017d495407e49a1e20a80389
tree3a92f95e53b1c5ed7aa87adeb76bc34d107997ff
parentf56bc2dfa852c399687c69dded419fa7a1be837b
libparted: enforce dos partition limit

The msdos partition table claimed a maximum partition count of 16
but would allow you to go beyond that.  This resulted in the kernel
not being informed of those partitions.  Corrected to enforce the
limit.

* NEWS (Bug fixes): Mention it.
* libparted/labels/dos.c (next_primary): Return -1 upon failure.
(next_logical): Stop no later than MAX_TOTAL_PART.
Throw exception and return -1 upon failure.
(msdos_partition_enumerate): Convert a negative partition number
return value from either of the above two to failure (return 0).
* tests/t9042-dos-partition-limit.sh: New file.
* tests/Makefile.am (TESTS): Add it.
NEWS
libparted/labels/dos.c
tests/Makefile.am
tests/t9042-dos-partition-limit.sh [new file with mode: 0644]