[parted/f14] - Fix bug in hfs probe code (#714758) - Make pc98 detection depend on specific signatures (#646053)

Brian C. Lane bcl at fedoraproject.org
Fri Oct 14 22:51:52 UTC 2011


commit f2299134e4ba419b8aa3e4747a44d8afc2ea2270
Author: Brian C. Lane <bcl at redhat.com>
Date:   Tue Oct 11 16:53:12 2011 -0700

    - Fix bug in hfs probe code (#714758)
    - Make pc98 detection depend on specific signatures (#646053)
    - Turn off -Werror
    - Patch the test/Makefile.in to add the new tests
    - Change new tests to use correct init script

 parted-2.3-update-the-tests.patch                  |  231 ++++++++++++++++++++
 ...ix-a-bug-in-the-hfs-probe-functions-71475.patch |   67 ++++++
 ...-make-pc98-detection-depend-on-signatures.patch |   75 +++++++
 ...-add-tests-for-new-pc98-signatures-646053.patch |   75 +++++++
 parted.spec                                        |   22 ++-
 5 files changed, 468 insertions(+), 2 deletions(-)
---
diff --git a/parted-2.3-update-the-tests.patch b/parted-2.3-update-the-tests.patch
new file mode 100644
index 0000000..bea0e70
--- /dev/null
+++ b/parted-2.3-update-the-tests.patch
@@ -0,0 +1,231 @@
+From d04930e45c418e042155778e1dbb91bd22700221 Mon Sep 17 00:00:00 2001
+From: Fedora Ninjas <parted-owner at fedoraproject.org>
+Date: Fri, 14 Oct 2011 10:56:50 -0700
+Subject: [PATCH] update the tests
+
+---
+ parted-2.3/tests/t2201-pc98-label-recog.sh |   49 +++++++++++++++++++++++++
+ tests/Makefile.in                          |   55 ++++++++++++----------------
+ tests/t2201-pc98-label-recog.sh            |    8 ++++-
+ 3 files changed, 80 insertions(+), 32 deletions(-)
+ create mode 100644 parted-2.3/tests/t2201-pc98-label-recog.sh
+
+diff --git a/parted-2.3/tests/t2201-pc98-label-recog.sh b/parted-2.3/tests/t2201-pc98-label-recog.sh
+new file mode 100644
+index 0000000..68058fe
+--- /dev/null
++++ b/parted-2.3/tests/t2201-pc98-label-recog.sh
+@@ -0,0 +1,49 @@
++#!/bin/sh
++# Recognize PC98 labeled disks
++
++# Copyright (C) 2011 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++if test "$VERBOSE" = yes; then
++  set -x
++  parted --version
++fi
++
++test_description='Recognized PC98 labeled disks'
++
++: ${srcdir=.}
++. $srcdir/t-lib.sh
++
++require_512_byte_sector_size_
++
++ss=$sector_size_
++N=8192
++dev=loop-file
++
++# create a file to simulate the underlying device
++dd if=/dev/null of=$dev bs=$ss seek=$N 2> /dev/null || fail=1
++
++# label the test disk
++parted -s $dev mklabel pc98 > out 2>&1 || fail=1
++compare out /dev/null || fail=1 # expect no output
++
++parted -s $dev p | grep "^Partition Table: pc98" || fail=1
++
++for s in "Linux 98" "GRUB/98 "; do
++    printf "$s" | dd bs=1c seek=4 of=$dev conv=notrunc || fail=1
++    parted -s $dev p | grep "^Partition Table: pc98" || fail=1
++done
++
++Exit $fail
+diff --git a/tests/Makefile.in b/tests/Makefile.in
+index 4221d17..7720220 100644
+--- a/tests/Makefile.in
++++ b/tests/Makefile.in
+@@ -1,9 +1,9 @@
+-# Makefile.in generated by automake 1.11a from Makefile.am.
++# Makefile.in generated by automake 1.11.1 from Makefile.am.
+ # @configure_input@
+ 
+ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010  Free Software
+-# Foundation, Inc.
++# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
++# Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+@@ -134,7 +134,7 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ 	$(AM_CFLAGS) $(CFLAGS)
+ AM_V_CC = $(am__v_CC_$(V))
+ am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+-am__v_CC_0 = @echo "  CC      " $@;
++am__v_CC_0 = @echo "  CC    " $@;
+ AM_V_at = $(am__v_at_$(V))
+ am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+ am__v_at_0 = @
+@@ -144,10 +144,10 @@ LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+ AM_V_CCLD = $(am__v_CCLD_$(V))
+ am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+-am__v_CCLD_0 = @echo "  CCLD    " $@;
++am__v_CCLD_0 = @echo "  CCLD  " $@;
+ AM_V_GEN = $(am__v_GEN_$(V))
+ am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+-am__v_GEN_0 = @echo "  GEN     " $@;
++am__v_GEN_0 = @echo "  GEN   " $@;
+ SOURCES = dup-clobber.c print-align.c print-max.c
+ DIST_SOURCES = dup-clobber.c print-align.c print-max.c
+ ETAGS = etags
+@@ -216,9 +216,8 @@ $(am__sh_e_setup);					\
+ $(am__vpath_adj_setup) $(am__vpath_adj)			\
+ srcdir=$(srcdir); export srcdir;			\
+ rm -f $@-t;						\
+-am__trap='rm -f '\''$(abs_builddir)/$@-t'\''; (exit $$st); exit $$st'; \
+-trap "st=129; $$am__trap" 1; trap "st=130; $$am__trap" 2;	\
+-trap "st=141; $$am__trap" 13; trap "st=143; $$am__trap" 15; \
++trap 'st=$$?; rm -f '\''$(abs_builddir)/$@-t'\''; (exit $$st); exit $$st' \
++  1 2 13 15;						\
+ am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;		\
+ test "x$$am__odir" = x. || $(MKDIR_P) "$$am__odir" || exit $$?;	\
+ if test -f "./$$f"; then dir=./;			\
+@@ -714,6 +713,8 @@ PARTED_LIBS = @PARTED_LIBS@
+ PARTED_USABLE_TEST_DIR = @PARTED_USABLE_TEST_DIR@
+ PATH_SEPARATOR = @PATH_SEPARATOR@
+ PKG_CONFIG = @PKG_CONFIG@
++PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
++PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+ POSUB = @POSUB@
+ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+ PRIPTR_PREFIX = @PRIPTR_PREFIX@
+@@ -934,6 +935,7 @@ TESTS = \
+   t1700-ext-probe.sh \
+   t2100-mkswap.sh \
+   t2200-dos-label-recog.sh \
++  t2201-pc98-label-recog.sh \
+   t2300-dos-label-extended-bootcode.sh \
+   t2310-dos-extended-2-sector-min-offset.sh \
+   t2400-dos-hfs-partition-type.sh \
+@@ -1084,23 +1086,26 @@ distclean-compile:
+ .c.o:
+ @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
++ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
++ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c $<
++ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+ 
+ .c.obj:
+ @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
++ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
++ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
++ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+ 
+ .c.lo:
+ @am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
++ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
++ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
++ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+ 
+ mostlyclean-libtool:
+ 	-rm -f *.lo
+@@ -1157,20 +1162,6 @@ GTAGS:
+ 	  && $(am__cd) $(top_srcdir) \
+ 	  && gtags -i $(GTAGS_ARGS) "$$here"
+ 
+-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+-	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+-	case "$(srcdir)" in \
+-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+-	  *) sdir=$(subdir)/$(srcdir) ;; \
+-	esac; \
+-	for i in $$list; do \
+-	  if test -f "$$i"; then \
+-	    echo "$(subdir)/$$i"; \
+-	  else \
+-	    echo "$$sdir/$$i"; \
+-	  fi; \
+-	done >> $(top_builddir)/cscope.files
+-
+ distclean-tags:
+ 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ 
+@@ -1366,6 +1357,8 @@ t2100-mkswap.sh.log: t2100-mkswap.sh
+ 	@p='t2100-mkswap.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+ t2200-dos-label-recog.sh.log: t2200-dos-label-recog.sh
+ 	@p='t2200-dos-label-recog.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
++t2201-pc98-label-recog.sh.log: t2201-pc98-label-recog.sh
++	@p='t2201-pc98-label-recog.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+ t2300-dos-label-extended-bootcode.sh.log: t2300-dos-label-extended-bootcode.sh
+ 	@p='t2300-dos-label-extended-bootcode.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+ t2310-dos-extended-2-sector-min-offset.sh.log: t2310-dos-extended-2-sector-min-offset.sh
+@@ -1556,8 +1549,8 @@ uninstall-am:
+ 	recheck-html
+ 
+ .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am check-html \
+-	clean clean-checkPROGRAMS clean-generic clean-libtool \
+-	cscopelist ctags distclean distclean-compile distclean-generic \
++	clean clean-checkPROGRAMS clean-generic clean-libtool ctags \
++	distclean distclean-compile distclean-generic \
+ 	distclean-libtool distclean-tags distdir dvi dvi-am html \
+ 	html-am info info-am install install-am install-data \
+ 	install-data-am install-dvi install-dvi-am install-exec \
+diff --git a/tests/t2201-pc98-label-recog.sh b/tests/t2201-pc98-label-recog.sh
+index 6228159..f8967a3 100644
+--- a/tests/t2201-pc98-label-recog.sh
++++ b/tests/t2201-pc98-label-recog.sh
+@@ -16,7 +16,13 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ 
+-. "${srcdir=.}/init.sh"; path_prepend_ ../parted
++if test "$VERBOSE" = yes; then
++  set -x
++  parted --version
++fi
++
++: ${srcdir=.}
++. $srcdir/t-lib.sh
+ 
+ require_512_byte_sector_size_
+ 
+-- 
+1.7.6.4
+
diff --git a/parted-3.0-libparted-Fix-a-bug-in-the-hfs-probe-functions-71475.patch b/parted-3.0-libparted-Fix-a-bug-in-the-hfs-probe-functions-71475.patch
new file mode 100644
index 0000000..f8fab9d
--- /dev/null
+++ b/parted-3.0-libparted-Fix-a-bug-in-the-hfs-probe-functions-71475.patch
@@ -0,0 +1,67 @@
+From fa9d7db0dfc89befe87a73f22e7d0473e505c9d9 Mon Sep 17 00:00:00 2001
+From: "Brian C. Lane" <bcl at redhat.com>
+Date: Wed, 5 Oct 2011 15:51:10 -0700
+Subject: [PATCH 4/4] libparted: Fix a bug in the hfs probe functions
+ (#714758)
+
+* libparted/fs/hfs/probe.c (hfsplus_probe): Add a check on the
+  search value and reject it if it is negative.
+  (hfsx_probe): Same
+  (hfs_and_wrapper_probe): Same
+---
+ libparted/fs/hfs/probe.c |   18 +++++++++++-------
+ 1 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/libparted/fs/hfs/probe.c b/libparted/fs/hfs/probe.c
+index 8c656cf..bf4d70b 100644
+--- a/libparted/fs/hfs/probe.c
++++ b/libparted/fs/hfs/probe.c
+@@ -82,7 +82,8 @@ hfs_and_wrapper_probe (PedGeometry* geom)
+ 		  + ((PedSector) PED_BE16_TO_CPU (mdb->total_blocks)
+ 		     * (PED_BE32_TO_CPU (mdb->block_size) / PED_SECTOR_SIZE_DEFAULT )));
+ 	max = search + (PED_BE32_TO_CPU (mdb->block_size) / PED_SECTOR_SIZE_DEFAULT);
+-	if (!(geom_ret = ped_geometry_new (geom->dev, geom->start, search + 2)))
++	if ((search < 0)
++	    || !(geom_ret = ped_geometry_new (geom->dev, geom->start, search + 2)))
+ 		return NULL;
+ 
+ 	for (; search < max; search++) {
+@@ -141,8 +142,9 @@ hfsplus_probe (PedGeometry* geom)
+ 		      - 2;
+ 		search = max - 2 * ( PED_BE32_TO_CPU (vh->block_size)
+ 				     / PED_SECTOR_SIZE_DEFAULT ) + 2;
+-		if (!(geom_ret = ped_geometry_new (geom->dev, geom->start,
+-						   search + 2)))
++		if ((search < 0)
++		    || !(geom_ret = ped_geometry_new (geom->dev, geom->start,
++						      search + 2)))
+ 			return NULL;
+ 
+ 		for (; search < max; search++) {
+@@ -156,8 +158,9 @@ hfsplus_probe (PedGeometry* geom)
+ 		search = ((PedSector) PED_BE32_TO_CPU (vh->total_blocks) - 1)
+ 		      * ( PED_BE32_TO_CPU (vh->block_size) / PED_SECTOR_SIZE_DEFAULT )
+ 		      - 1;
+-		if (!ped_geometry_set (geom_ret, geom_ret->start,
+-					       search + 2)
++		if ((search < 0)
++		    || !ped_geometry_set (geom_ret, geom_ret->start,
++					  search + 2)
+ 		    || !ped_geometry_read (geom_ret, buf, search, 1)
+ 		    || vh->signature != PED_CPU_TO_BE16 (HFSP_SIGNATURE)) {
+ 		    	ped_geometry_destroy (geom_ret);
+@@ -213,8 +216,9 @@ hfsx_probe (PedGeometry* geom)
+ 		      * ( PED_BE32_TO_CPU (vh->block_size) / PED_SECTOR_SIZE_DEFAULT )
+ 		      - 2;
+ 	search = max - ( PED_BE32_TO_CPU (vh->block_size) / PED_SECTOR_SIZE_DEFAULT );
+-	if (!(geom_ret = ped_geometry_new (geom->dev, geom->start,
+-					   search + 2)))
++	if ((search < 0)
++	    || !(geom_ret = ped_geometry_new (geom->dev, geom->start,
++					      search + 2)))
+ 		return NULL;
+ 	for (; search < max; search++) {
+ 		if (!ped_geometry_set (geom_ret, geom_ret->start,
+-- 
+1.7.6.4
+
diff --git a/parted-3.0-libparted-make-pc98-detection-depend-on-signatures.patch b/parted-3.0-libparted-make-pc98-detection-depend-on-signatures.patch
new file mode 100644
index 0000000..2590b8a
--- /dev/null
+++ b/parted-3.0-libparted-make-pc98-detection-depend-on-signatures.patch
@@ -0,0 +1,75 @@
+From 68ff2e0c7563054e95389c1da5164b3d9c75c52b Mon Sep 17 00:00:00 2001
+From: "Brian C. Lane" <bcl at redhat.com>
+Date: Fri, 7 Oct 2011 10:56:00 -0700
+Subject: [PATCH 1/2] libparted: make pc98 detection depend on signatures
+ (#646053)
+
+pc98 is not a common disk label. Change pc98_probe to only return true
+if one of the recognized signatures is present.
+Currently these include:
+
+IPL1
+Linux 98
+GRUB/98
+
+This will prevent false-positive detection on msdos labeled disks
+
+* libparted/labels/pc98.c (pc98_probe): Change to require signature
+  (pc98_check_ipl_signature): Add more signatures
+---
+ libparted/labels/pc98.c |   32 ++++++++++----------------------
+ 1 files changed, 10 insertions(+), 22 deletions(-)
+
+diff --git a/libparted/labels/pc98.c b/libparted/labels/pc98.c
+index 3afa8a2..ea3cf4e 100644
+--- a/libparted/labels/pc98.c
++++ b/libparted/labels/pc98.c
+@@ -140,7 +140,14 @@ pc98_check_magic (const PC98RawTable *part_table)
+ static int
+ pc98_check_ipl_signature (const PC98RawTable *part_table)
+ {
+-	return !memcmp (part_table->boot_code + 4, "IPL1", 4);
++	if (memcmp (part_table->boot_code + 4, "IPL1", 4) == 0)
++		return 1;
++	else if (memcmp (part_table->boot_code + 4, "Linux 98", 8) == 0)
++		return 1;
++	else if (memcmp (part_table->boot_code + 4, "GRUB/98 ", 8) == 0)
++		return 1;
++	else
++		return 0;
+ }
+ 
+ static int
+@@ -192,27 +199,8 @@ pc98_probe (const PedDevice *dev)
+ 	if (!pc98_check_magic (&part_table))
+ 		return 0;
+ 
+-	/* check consistency */
+-	empty = 1;
+-	for (p = part_table.partitions;
+-	     p < part_table.partitions + MAX_PART_COUNT;
+-	     p++)
+-	{
+-		if (p->mid == 0 && p->sid == 0)
+-			continue;
+-		empty = 0;
+-		if (!check_partition_consistency (dev, p))
+-			return 0;
+-	}
+-
+-	/* check boot loader */
+-	if (pc98_check_ipl_signature (&part_table))
+-		return 1;
+-	else if (part_table.boot_code[0])	/* invalid boot loader */
+-		return 0;
+-
+-	/* Not to mistake msdos disk map for PC-9800's empty disk map  */
+-	if (empty)
++	/* check for boot loader signatures */
++	if (!pc98_check_ipl_signature (&part_table))
+ 		return 0;
+ 
+ 	return 1;
+-- 
+1.7.6.4
+
diff --git a/parted-3.0-tests-add-tests-for-new-pc98-signatures-646053.patch b/parted-3.0-tests-add-tests-for-new-pc98-signatures-646053.patch
new file mode 100644
index 0000000..375d018
--- /dev/null
+++ b/parted-3.0-tests-add-tests-for-new-pc98-signatures-646053.patch
@@ -0,0 +1,75 @@
+From 3d39aaca84ce44e4108f214b76bf2b7a127a3ac2 Mon Sep 17 00:00:00 2001
+From: "Brian C. Lane" <bcl at redhat.com>
+Date: Fri, 7 Oct 2011 11:41:25 -0700
+Subject: [PATCH 6/6] tests: add tests for new pc98 signatures (#646053)
+
+ * tests/t2201-pc98-label-recog.sh: New file
+ * tests/Makefile.am: Add test
+---
+ tests/Makefile.am               |    1 +
+ tests/t2201-pc98-label-recog.sh |   41 +++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 42 insertions(+), 0 deletions(-)
+ create mode 100755 tests/t2201-pc98-label-recog.sh
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index f507358..18a664b 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -23,6 +23,7 @@ TESTS = \
+   t1700-ext-probe.sh \
+   t2100-mkswap.sh \
+   t2200-dos-label-recog.sh \
++  t2201-pc98-label-recog.sh \
+   t2300-dos-label-extended-bootcode.sh \
+   t2310-dos-extended-2-sector-min-offset.sh \
+   t2400-dos-hfs-partition-type.sh \
+diff --git a/tests/t2201-pc98-label-recog.sh b/tests/t2201-pc98-label-recog.sh
+new file mode 100755
+index 0000000..6228159
+--- /dev/null
++++ b/tests/t2201-pc98-label-recog.sh
+@@ -0,0 +1,41 @@
++#!/bin/sh
++# Recognize PC98 labeled disks
++
++# Copyright (C) 2011 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++. "${srcdir=.}/init.sh"; path_prepend_ ../parted
++
++require_512_byte_sector_size_
++
++ss=$sector_size_
++N=8192
++dev=loop-file
++
++# create a file to simulate the underlying device
++dd if=/dev/null of=$dev bs=$ss seek=$N 2> /dev/null || fail=1
++
++# label the test disk
++parted -s $dev mklabel pc98 > out 2>&1 || fail=1
++compare out /dev/null || fail=1 # expect no output
++
++parted -s $dev p | grep "^Partition Table: pc98" || fail=1
++
++for s in "Linux 98" "GRUB/98 "; do
++    printf "$s" | dd bs=1c seek=4 of=$dev conv=notrunc || fail=1
++    parted -s $dev p | grep "^Partition Table: pc98" || fail=1
++done
++
++Exit $fail
+-- 
+1.7.6.4
+
diff --git a/parted.spec b/parted.spec
index c38083b..e3d8a84 100644
--- a/parted.spec
+++ b/parted.spec
@@ -4,7 +4,7 @@
 Summary: The GNU disk partition manipulation program
 Name:    parted
 Version: 2.3
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: GPLv3+
 Group:   Applications/System
 URL:     http://www.gnu.org/software/parted
@@ -19,6 +19,10 @@ Patch0: parted-2.2-hi-major-sd-rh611691.patch
 # Report partitions changes when using blkext major numbers
 Patch1: parted-2.3-lpn.patch
 Patch2: parted-2.3-dasd-part.patch
+Patch3: parted-3.0-libparted-Fix-a-bug-in-the-hfs-probe-functions-71475.patch
+Patch4: parted-3.0-libparted-make-pc98-detection-depend-on-signatures.patch
+Patch5: parted-3.0-tests-add-tests-for-new-pc98-signatures-646053.patch
+Patch6: parted-2.3-update-the-tests.patch
 
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: e2fsprogs-devel
@@ -64,11 +68,16 @@ gpg --verify %{SOURCE1} %{SOURCE0}
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
 iconv -f ISO-8859-1 -t UTF8 AUTHORS > tmp; touch -r AUTHORS tmp; mv tmp AUTHORS
 
 
 %build
-%configure --enable-selinux --disable-static
+CFLAGS="$RPM_OPT_FLAGS -Wno-unused-but-set-variable"; export CFLAGS
+%configure --enable-selinux --disable-static --disable-Werror
 # Don't use rpath!
 %{__sed} -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
 %{__sed} -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
@@ -139,6 +148,15 @@ fi
 
 
 %changelog
+* Tue Oct 11 2011 Brian C. Lane <bcl at redhat.com> - 2.3-11
+- Fix bug in hfs probe code (#714758)
+- Make pc98 detection depend on specific signatures (#646053)
+- Remove -Werror
+- Patch the test/Makefile.in to add the new tests
+
+* Wed Feb 09 2011 Brian C. Lane <bcl at redhat.com> - 2.3-7
+- Tell GCC to stop treating unused variable warnings as errors
+
 * Thu Nov 18 2010 Brian C. Lane <bcl at redhat.com> 2.3-4
 - Add patch to allow reread of partitions with DASD disks (#651478)
 


More information about the scm-commits mailing list