From 6e650f8895631dabc5b8bb809bed024896c3dcc5 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 6 Feb 2013 17:26:46 +0100 Subject: [PATCH] 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 Signed-off-by: Karel Zak --- libblkid/src/probe.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c index f7f90761a2..9e3f8f6908 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; } -- 2.47.3