| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
open() returns -1 on error, not 0 (stdin).
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to spec the FAT filesystem label is not terminated by a
\0-byte but instead has a fixed length where the name is padded by
blanks.
Before libblkid-tiny just passed the always 11 bytes long blank padded
string through, however it makes matching for a filesystem label
inconsistent with other filesystems, which use a \0-terminated string.
Before: "foobar "
After : "foobar"
Signed-off-by: Mirko Vogt <mirko-openwrt@nanl.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
f2fs max label length is 1024B (512 * uint16_t) which is way above
current 256B used in `struct blkid_struct_probe` which renders labels on
f2fs system unusable:
$ mkfs.f2fs -l drive /dev/sda1
$ block info /dev/sda1
label buffer too small 1024 > 255
So increase the label buffer again in order to make enough space for
f2fs labels.
Fixes: FS#2735
Signed-off-by: Petr Štetiar <ynezz@true.cz>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit f0ca7e80d7a171701d0d04a3eae22d97f15d0683 upstream.
* Use only label from the root directory and do not fallback to the label
stored in boot sector. This is how MS-DOS 6.22, MS-DOS 7.10, Windows 98,
Windows XP and also Windows 10 behave. Moreover Windows XP and Windows 10
do not touch label in boot sector anymore, so removing FAT label on those
Windowses leads to having old label still stored in boot sector (which
MS-DOS and Windows fully ignore).
* Label entry "NO NAME" in root directory is treated as label "NO NAME"
instead of empty label. In root directory it has no special meaning.
String "NO NAME" has a special meaning (empty label) only for label
stored in boot sector.
* Label from the boot sector is now stored into LABEL_FATBOOT field. So if
there are applications which depends or needs to read this label, they
have ability.
After this change LABEL always correspondent to the label from the root
directory and LABEL_FATBOOT to the label stored in the boot sector. If some
of those labels is missing or is not present (e.g. "NO LABEL" in boot
sector) then particular field is not set.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
[rmilecki: drop unneeded now downstream hacks for handling spaces]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
|
|
|
|
|
|
|
|
|
| |
commit e526f503918cc29d8b1ccf36a5c3a34645d2be6e upstream.
When FAT directory entry has leading byte 0x05 it is interpreted as byte
0xE5. This is how FAT stores file name which starts with byte 0xE5 as
leading byte in 0xE5 in FAT directory entry means that file slot is empty.
Fixes: #533
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
The memory pointed to by ns can be reallocated when checking mft records
Fixes FS#2129
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
|
|
|
|
|
|
|
| |
readlink() truncates and does not null terminate the string when more
bytes would be written than available. Just increase the char array by
one and assume that there is a problem when all bytes are needed.
Coverity: #1330087, #1329991
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
|
|
|
| |
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Btrfs max label lenght is 255. Increment the blkid_struct_probe struct to respect this new max value.
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
|
|
|
|
|
| |
Btrfs label length is 256 included the termination char ( '\0' ) as the real max length is 255 (less than 256 from the wiki).
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
|
|
|
| |
Signed-off-by: John Crispin <john@phrozen.org>
|
|
|
|
|
|
| |
the libblkid copies len+1 bytes causing a buffer overrun.
Signed-off-by: John Crispin <john@phrozen.org>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
On glibc 2.25, sys/sysmacros.h needs to be included for makedev, major
and minor.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
|
|
|
|
|
| |
The "name" member of struct blkid_struct_probe is not used anywhere anymore
so remove it from the definition to save some stack and heap space.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
|
|
| |
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
|
|
|
|
|
|
|
| |
This updates the relevant source files to util-linux changeset
4419ffb9eff5801fdbd385a4a6199b3877f802ad.
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
|
|
|
|
| |
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
|
|
| |
Signed-off-by: Jeff Waugh <jdub@bethesignal.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
We already had ubifs idinfo, so only /dev/ubiN_M support was missing.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
|
|
|
| |
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|