rpms/util-linux-ng/F-13 util-linux-ng-2.17-blkid-minix.patch, NONE, 1.1 util-linux-ng.spec, 1.76, 1.77

kzak kzak at fedoraproject.org
Mon Mar 8 13:17:10 UTC 2010


Author: kzak

Update of /cvs/pkgs/rpms/util-linux-ng/F-13
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv17119

Modified Files:
	util-linux-ng.spec 
Added Files:
	util-linux-ng-2.17-blkid-minix.patch 
Log Message:
* Mon Mar  8 2010 Karel Zak <kzak at redhat.com> 2.17.1-3
- fix #570606 - blkid (and related) should be a bit more robust


util-linux-ng-2.17-blkid-minix.patch:
 minix.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

--- NEW FILE util-linux-ng-2.17-blkid-minix.patch ---
>From 74b1659ddaac4aa409b56d1eaa07d87b5b11b98e Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak at redhat.com>
Date: Mon, 8 Mar 2010 13:05:09 +0100
Subject: [PATCH] libblkid: more robust minix probing

Unfortunately, it's still possible to interpret some parts of ext3
filesystem as minix superblock ;-(

So, the most robust is to check for the extN magic string in minix
probing function.

Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=570606
Signed-off-by: Karel Zak <kzak at redhat.com>
---
 shlibs/blkid/src/superblocks/minix.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/shlibs/blkid/src/superblocks/minix.c b/shlibs/blkid/src/superblocks/minix.c
index 7b314ab..3290c27 100644
--- a/shlibs/blkid/src/superblocks/minix.c
+++ b/shlibs/blkid/src/superblocks/minix.c
@@ -9,6 +9,7 @@
  * GNU Lesser General Public License.
  */
 
+#include <string.h>
 #include "superblocks.h"
 
 struct minix_super_block {
@@ -45,6 +46,7 @@ struct minix3_super_block {
 
 static int probe_minix(blkid_probe pr, const struct blkid_idmag *mag)
 {
+	unsigned char *ext;
 	int version;
 
 	/* for more details see magic strings below */
@@ -88,6 +90,14 @@ static int probe_minix(blkid_probe pr, const struct blkid_idmag *mag)
 
 	}
 
+	/* unfortunately, some parts of ext3 is sometimes possible to
+	 * interpreted as minix superblock. So check for extN magic
+	 * string. (For extN magic string and offsets see ext.c.)
+	 */
+	ext = blkid_probe_get_buffer(pr, 0x400 + 0x38, 2);
+	if (ext && memcmp(ext, "\123\357", 2) == 0)
+		return -1;
+
 	blkid_probe_sprintf_version(pr, "%d", version);
 	return 0;
 }
-- 
1.6.6



Index: util-linux-ng.spec
===================================================================
RCS file: /cvs/pkgs/rpms/util-linux-ng/F-13/util-linux-ng.spec,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -p -r1.76 -r1.77
--- util-linux-ng.spec	3 Mar 2010 16:01:23 -0000	1.76
+++ util-linux-ng.spec	8 Mar 2010 13:17:10 -0000	1.77
@@ -2,7 +2,7 @@
 Summary: A collection of basic system utilities
 Name: util-linux-ng
 Version: 2.17.1
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ and BSD with advertising and Public Domain
 Group: System Environment/Base
 URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng
@@ -106,6 +106,10 @@ Patch8: util-linux-ng-2.15-ipcs-32bit.pa
 # 570136 - RHEL6: libblkid: support alignment_offset=-1 
 Patch9: util-linux-ng-2.17-blkid-alignment-offset.patch
 
+### Upstream Patches
+###
+# 570606 - blkid (and related) should be a bit more robust
+Patch10: util-linux-ng-2.17-blkid-minix.patch
 
 %description
 The util-linux-ng package contains a large variety of low-level system
@@ -200,6 +204,7 @@ cp %{SOURCE8} %{SOURCE9} .
 %patch7 -p1
 %patch8 -p1
 %patch9 -p1
+%patch10 -p1
 
 %build
 unset LINGUAS || :
@@ -719,6 +724,9 @@ fi
 
 
 %changelog
+* Mon Mar  8 2010 Karel Zak <kzak at redhat.com> 2.17.1-3
+- fix #570606 - blkid (and related) should be a bit more robust
+
 * Wed Mar  3 2010 Karel Zak <kzak at redhat.com> 2.17.1-2
 - fix #570136 - RHEL6: libblkid: support alignment_offset=-1
 



More information about the scm-commits mailing list