summaryrefslogtreecommitdiff
path: root/libblkid-tiny/libblkid-tiny.c
Commit message (Collapse)AuthorAgeFilesLines
* libblkid-tiny: add exfat superblock supportHEADmasterRafał Miłecki2023-02-281-0/+1
| | | | | | | | exFAT became very popular over last years and also well supported with Linux kernel driver and macOS support. It's commonly used for USB drivers. Port a simple support for it from util-linux / libblkid. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* fstools: fix a couple of minor code problemsDaniel Golle2021-11-161-5/+13
| | | | | | Improve error handling and fix a resource leak inside an error path. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* libblkid-tiny: fix invalid open syscall return checkDaniel Danzberger2021-08-031-1/+1
| | | | | | open() returns -1 on error, not 0 (stdin). Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
* libblkid-tiny: fix buffer overflowDaniel Golle2021-05-161-1/+0
| | | | | | | | | | | | | | | | 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: add blkid_probe_set_id_label() stubRafał Miłecki2019-12-201-0/+6
| | | | | | | This stub will allow porting more upstream code without commenting out calls and them unused variables. This will simplify maintenance. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* libblkid-tiny: use separated buffer for each block device readRafał Miłecki2019-12-201-22/+14
| | | | | | | | | | | | | | | | This allows reading multiple chunks of block device data and operating on them simultaneously. Previous implementation was using a single buffer (except for reading more data than allocated size) and subsequent reads were corrupting memory of previously returned buffers. This fixes e.g. problem with reading NTFS UUID and validating VFAT signature. Implementation is based on original libblkid code which handles it similarly. Buffers are put on probe internal list and freed when releasing a probe struct. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* libblkid-tiny: adds blkid_probe_set_utf8label supportAnsuel Smith2019-09-031-0/+15
| | | | | | Currently set_utf8label support is missing. Adds a stripped down version of encode.c file from original libblkid and adds the function to libblkid-tiny.c. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* libblkid-tiny: add support for NTFS superblockRafał Miłecki2017-12-291-0/+1
| | | | | | | | | Its copied from the util-linux project and its libblkid. Call to the blkid_probe_set_utf8label was commented out due to libblkid-tiny not supporting it yet. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Acked-by: John Crispin <john@phrozen.org>
* libblkid-tiny: add support for UBI superblockRafał Miłecki2017-08-071-0/+1
| | | | | | | | | | | Detecting UBI superblock may be useful for tools wanting to simplify or automate attaching UBI. Please note it's not directly related to the ubifs support which is just a filesystem working on top of UBI volume. This patch adds simple code reading UBI version and unique number and setting it in the blkid_probe. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* libblkid-tiny: avoid setting phantom UUIDsJo-Philipp Wich2016-10-171-3/+2
| | | | | | | | | | | When blkid_probe_set_uuid_as() is invoked with a non-NULL name parameter then the name parameter denotes the kind of UUID (like "EXT_JOURNAL") not the name of the file system. Only copy the UUID value to the probe uuid member if the given name is either NULL or "UUID". Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* libblkid-tiny: Add F2FS supportMartin Blumenstingl2015-10-291-0/+1
| | | | Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
* libblkid-tiny: Update the code from util-linux's libblkidMartin Blumenstingl2015-10-291-0/+1
| | | | | | | This updates the relevant source files to util-linux changeset 4419ffb9eff5801fdbd385a4a6199b3877f802ad. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
* properly handle return codesJohn Crispin2015-03-281-1/+2
| | | | Signed-off-by: John Crispin <blogic@openwrt.org>
* libblkid-tiny: add btrfs probe infoDaniel Golle2015-01-071-0/+1
| | | | | | | | | | | | | | | This only adds the magic for btrfs to show btrfs volumes in block detect. In order to properly support btrfs with more than one device and avoid trying to mount the same device group once for each instance we have to make sure that only one device per group will be mounted (btrfs then automatically detects all other devices of the group). For unmounting, the opposite should be applied: umount if called for any of the devices in a mounted device group, unmount the filesystem. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* support UBI blocks (volumes)Rafał Miłecki2015-01-061-1/+1
| | | | | | We already had ubifs idinfo, so only /dev/ubiN_M support was missing. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
* various updatesJohn Crispin2014-04-011-0/+3
| | | | Signed-off-by: John Crispin <blogic@openwrt.org>
* initial import of fs-tools packageJohn Crispin2014-03-121-0/+217
Signed-off-by: John Crispin <blogic@openwrt.org>