summaryrefslogtreecommitdiffstats
path: root/libblkid/src/probe.c
diff options
context:
space:
mode:
authorKarel Zak2013-02-06 17:26:46 +0100
committerKarel Zak2013-02-06 17:39:28 +0100
commit6e650f8895631dabc5b8bb809bed024896c3dcc5 (patch)
treeedffd946a10714e4e3db65841ade067ad1928817 /libblkid/src/probe.c
parentsetpriv: Fix an error message typo (diff)
downloadkernel-qcow2-util-linux-6e650f8895631dabc5b8bb809bed024896c3dcc5.tar.gz
kernel-qcow2-util-linux-6e650f8895631dabc5b8bb809bed024896c3dcc5.tar.xz
kernel-qcow2-util-linux-6e650f8895631dabc5b8bb809bed024896c3dcc5.zip
libblkid: make blkid_new_probe_from_filename() usable on whole-disk
This is stupid bug, when libblkid probe for partition table on whole-disk device with old 0.90 Linux RAID then it creates clone of the struct blkid_probe to avoid collisions with the original probing setting. If the cloned prober is unnecessary then it's deallocated by blkid_free_probe() ... and this function also closes the file descriptor if the device has been opened by blkid_new_probe_from_filename(). Fortunately we usually use open() + blkid_probe_set_device(), ... except wipefs(1). Reported-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/probe.c')
-rw-r--r--libblkid/src/probe.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
index f7f90761a..9e3f8f690 100644
--- a/libblkid/src/probe.c
+++ b/libblkid/src/probe.c
@@ -183,6 +183,8 @@ blkid_probe blkid_clone_probe(blkid_probe parent)
pr->flags = parent->flags;
pr->parent = parent;
+ pr->flags &= ~BLKID_FL_PRIVATE_FD;
+
return pr;
}