summaryrefslogtreecommitdiff
path: root/probe.c
Commit message (Collapse)AuthorAgeFilesLines
* libblkid-tiny: fix buffer overflowDaniel Golle2021-05-161-4/+2
| | | | | | | | | | | | | | | | Copying device name into a fixed-length buffer is problematic as the name can be longer than the buffer, resulting in subsequent fields getting corrupted and potentially even worse things. Drop strcpy of device name and use of the copied value as it is known anyway. Before this fix: /dev/mapper/owrt--volumes--e093cc66-rw_test: UUID="c66-rw_test" LABEL="test" VERSION="1.14" TYPE="f2fs" After this fix: /dev/mapper/owrt--volumes--e093cc66-rw_test: UUID="5eda3e52-3427-493a-a6d6-ffdb5a5836fd" LABEL="test" VERSION="1.14" TYPE="f2fs" Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* libblkid-tiny: fix symbol collision with full libblkidJo-Philipp Wich2019-12-221-2/+2
| | | | | | | | | | The recent introduction of blkid_new_probe() and blkid_free_probe() in the dynamically linked libblkid-tiny caused the dlopen'd libblkid.so to call into the wrong version of blkid_new_probe() within blkid_new_probe_from_filename(), leading to memory corruption and eventual segmentation faults. Fixes: b82c5c1 ("libblkid-tiny: add functions for allocating & freeing probe struct") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* libblkid-tiny: add functions for allocating & freeing probe structRafał Miłecki2019-12-201-16/+22
| | | | | | | | | | This adds blkid_new_probe() and blkid_free_probe() which have to be used in place of simple struct memory allocation. They will allow extending probe struct by any extra initialization code and resources release. Newly introduced probe.c file is based on original libblkid's code. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* probe: stop handling name propertyJo-Philipp Wich2016-10-171-5/+1
| | | | | | | | | In the full liblkid there is no tag called "NAME" and the name value reported by libblkid-tiny was just the kind of uuid passed to blkid_probe_set_uuid_as(). Strip any handling of this property to allow removing it from libblkid-tiny. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* probe: add full libblkid supportJo-Philipp Wich2016-10-171-3/+10
| | | | | | | Attempt to dlopen() libblkid.so at runtime and use it for proping filesystems if available. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* block: add probe abstraction layerJo-Philipp Wich2016-10-161-0/+69
Add an abstraction layer which separates block.c from libblkid-tiny implementation details in order to prepare support for optionally using the full libblkid. Signed-off-by: Jo-Philipp Wich <jo@mein.io>