summaryrefslogtreecommitdiff
path: root/shlibs/blkid
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2010-09-07 11:30:50 +0200
committerKarel Zak <kzak@redhat.com>2010-09-07 11:30:50 +0200
commit23489c26252f1c40407804e0cd4964835db18e8c (patch)
treee2c75c3cea74940b9f0995d2529d6ebf756de07b /shlibs/blkid
parent74089287cf72acb42523e9eacef319b26ba74a07 (diff)
downloadutil-linux-old-23489c26252f1c40407804e0cd4964835db18e8c.tar.gz
libblkid: don't ignore zero for SBMAGIC_OFFSET
The side effect of this bug is that wipefs(8) does not report LUKS... Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/blkid')
-rw-r--r--shlibs/blkid/src/superblocks/superblocks.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/shlibs/blkid/src/superblocks/superblocks.c b/shlibs/blkid/src/superblocks/superblocks.c
index 3d66d98c..95c10d6e 100644
--- a/shlibs/blkid/src/superblocks/superblocks.c
+++ b/shlibs/blkid/src/superblocks/superblocks.c
@@ -487,10 +487,9 @@ int blkid_probe_set_magic(blkid_probe pr, blkid_loff_t offset,
int rc = 0;
struct blkid_chain *chn = blkid_probe_get_chain(pr);
- if (chn->flags & BLKID_SUBLKS_MAGIC) {
- if (magic && len)
- rc = blkid_probe_set_value(pr, "SBMAGIC", magic, len);
- if (!rc && offset)
+ if (magic && len && (chn->flags & BLKID_SUBLKS_MAGIC)) {
+ rc = blkid_probe_set_value(pr, "SBMAGIC", magic, len);
+ if (!rc)
rc = blkid_probe_sprintf_value(pr, "SBMAGIC_OFFSET",
"%llu", offset);
}