[util-linux] Fix libblkid's squashfs probe return checking.

Peter Jones pjones at fedoraproject.org
Wed Jun 25 21:21:24 UTC 2014


commit 9016a84fbaaacff644d26d0f30b4931ca8afb551
Author: Peter Jones <pjones at redhat.com>
Date:   Wed Jun 25 17:21:26 2014 -0400

    Fix libblkid's squashfs probe return checking.
    
      Related: rhbz#1112315

 util-linux-squashfs-probe.patch |   46 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 46 insertions(+), 0 deletions(-)
---
diff --git a/util-linux-squashfs-probe.patch b/util-linux-squashfs-probe.patch
new file mode 100644
index 0000000..2e3779d
--- /dev/null
+++ b/util-linux-squashfs-probe.patch
@@ -0,0 +1,46 @@
+From cbccd7a4f8ffcded136e83fb7c3aeedc393d312d Mon Sep 17 00:00:00 2001
+From: David Shea <dshea at redhat.com>
+Date: Mon, 23 Jun 2014 13:41:48 -0400
+Subject: [PATCH] libblkid: correct the return values in squashfs probe
+
+Returning -1 can cause squashfs v3 detection to make v4 detection fail.
+
+Signed-off-by: Karel Zak <kzak at redhat.com>
+---
+ libblkid/src/superblocks/squashfs.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/libblkid/src/superblocks/squashfs.c b/libblkid/src/superblocks/squashfs.c
+index a35d60f..8ed2838 100644
+--- a/libblkid/src/superblocks/squashfs.c
++++ b/libblkid/src/superblocks/squashfs.c
+@@ -41,7 +41,7 @@ static int probe_squashfs(blkid_probe pr, const struct blkid_idmag *mag)
+ 	major = le16_to_cpu(sq->s_major);
+ 	minor = le16_to_cpu(sq->s_minor);
+ 	if (major < 4)
+-		return -1;
++		return 1;
+ 
+ 	blkid_probe_sprintf_version(pr, "%u.%u", major, minor);
+ 
+@@ -56,7 +56,7 @@ static int probe_squashfs3(blkid_probe pr, const struct blkid_idmag *mag)
+ 
+ 	sq = blkid_probe_get_sb(pr, mag, struct sqsh_super_block);
+ 	if (!sq)
+-		return -1;
++		return errno ? -errno : 1;
+ 
+ 	if (strcmp(mag->magic, "sqsh") == 0) {
+ 		major = be16_to_cpu(sq->s_major);
+@@ -67,7 +67,7 @@ static int probe_squashfs3(blkid_probe pr, const struct blkid_idmag *mag)
+ 	}
+ 
+ 	if (major > 3)
+-		return -1;
++		return 1;
+ 
+ 	blkid_probe_sprintf_version(pr, "%u.%u", major, minor);
+ 
+-- 
+1.9.3
+


More information about the scm-commits mailing list