summaryrefslogtreecommitdiffstats
path: root/libblkid
Commit message (Collapse)AuthorAgeFilesLines
* libblkid: remove dependence on libuuidKarel Zak2019-01-224-23/+1Star
| | | | | | | | | | | Currently we use libuuid to print UUID only. This code is possible to replace by one snprintf(). It seems better to duplicate this one snprintf than force all distros to keep libuuid together with libblkid. Note, this scenario has been already supported on --disable-libuuid. Reported-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: improve whole-disk detection when read /proc/partitionsKarel Zak2019-01-081-11/+14
| | | | | | | | | | | | | | | | | | blkid(8) in high-level mode checks partitions and unpartitioned whole-disk devices from the file /proc/partitions. The current heuristic assumes that partition name ends with a digit. Unfortunately, this is not correct -- for example md0 or nvme0n1 are whole-disk devices. This commit uses sysfs_devno_is_wholedisk() to make sure the device is a partition (according to kernel or DM). It's probably more expensive, because this way requires more syscalls (to read stuff from /sys etc.). The patch also adds more information to the blkid(8) man page. Addresses: https://github.com/karelzak/util-linux/issues/728 Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: (ntfs) fix compiler warning [-Wpedantic]Karel Zak2019-01-021-6/+4Star
| | | | | | | | libblkid/src/superblocks/ntfs.c:80:2: warning: ISO C restricts enumerator values to range of 'int' (4294967295 is too large) [-Wpedantic] Addressed: https://github.com/karelzak/util-linux/pull/732 Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'master' of https://github.com/kvanals/util-linuxKarel Zak2019-01-021-2/+0Star
|\ | | | | | | | | | | | | * 'master' of https://github.com/kvanals/util-linux: Removed BlueStore VERSION information as it is gibberish Updated BlueStore expected result Added BlueStore test image
| * Removed BlueStore VERSION information as it is gibberishKenneth Van Alstyne2018-12-181-2/+0Star
| |
* | libblkid: (bluestore) terminate magic strings arrayKarel Zak2018-12-171-1/+2
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | Merge branch 'master' of https://github.com/kvanals/util-linuxKarel Zak2018-12-174-0/+57
|\| | | | | | | | | | | * 'master' of https://github.com/kvanals/util-linux: Finished up BlueStore support Added support for detecting Ceph BlueStore Block Devices
| * Finished up BlueStore supportKenneth Van Alstyne2018-12-143-0/+3
| |
| * Added support for detecting Ceph BlueStore Block DevicesKenneth Van Alstyne2018-12-141-0/+54
| |
* | libblkid: stratis: correct byte orderTony Asleson2018-12-171-2/+2
|/ | | | | | | Stratis superblock is little endian, ensure we retrieve the number of sectors and initialization time correctly. Signed-off-by: Tony Asleson <tasleson@redhat.com>
* libblkid: add check for DRBD9Roland Kammerer2018-11-211-4/+107
| | | | | | | This adds the according meta-data structs + defines and an additional function to detect DRBD9 magics. Signed-off-by: Roland Kammerer <roland.kammerer@linbit.com>
* libblkid: Fix hidding typoAndreas Henriksson2018-11-211-1/+1
| | | | | | Spelling error spotted by lintian. Signed-off-by: Andreas Henriksson <andreas@fatal.se>
* libblkid: fix detection of dm-integrity superblockMilan Broz2018-11-121-1/+1
| | | | | | | Some new features in Linux kernel 4.19 for dm-integrity use metadata format version 2, patch adds it to detection. Signed-off-by: Milan Broz <gmazyland@gmail.com>
* docs: use SPDX license namesKarel Zak2018-08-161-1/+1
| | | | | | | | | | Let's use standardized names for licenses. The names used by SPDX makes things more obvious at first glance. For complete list see: https://spdx.org/licenses/ Note, this commit does not change any license or so... Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use xstrncpy() for PT id [coverity scan]Karel Zak2018-07-251-1/+2
| | | | | | | | It's probably unnecessary change as blkid_parttable_set_id() is used by MBR code and we use proper buffer size there, but better safe than sorry. Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: const qualifier cleanupKarel Zak2018-07-2011-53/+55
| | | | | | | | * use "const" in functions where we don't modify arguments * use "const" when cast from const buffer to any struct (superblock etc.) Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: Check for a secondary LUKS2 header.Milan Broz2018-07-111-13/+47
| | | | | | | | | | | This patch adds search for a secondary LUKS2 header, if the primary one is corrupted. This patch is primarily needed for wipefs that should wipe both signatures (otherwise LUKS2 header recovery can use secondary header and revert wipefs action). Signed-off-by: Milan Broz <gmazyland@gmail.com>
* libblkid: Add more APFS checking to avoid false positivesHarry Mallon2018-07-061-0/+62
|
* libblkid: Add very basic APFS recognitionHarry Mallon2018-06-254-1/+23
|
* libblkid: use new ul_path_* APIKarel Zak2018-06-213-42/+51
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'master' of https://github.com/pali/util-linuxKarel Zak2018-05-281-0/+10
|\ | | | | | | | | * 'master' of https://github.com/pali/util-linux: libblkid: udf: Fix reporting UDF 2.60 revision
| * libblkid: udf: Fix reporting UDF 2.60 revisionPali Rohár2018-05-251-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | According to the UDF 2.60 specification, the Minimum UDF Read Revision value shall be at most #0250 for all media with a UDF 2.60 file system. So in this case use Minimum UDF Write Revision as ID_FS_VERSION to distinguish between UDF 2.50 and UDF 2.60 discs. This commit also adds a testing Blu-Ray Recordable image with UDF revision 2.60 created by Nero which really sets Minimum UDF Read Revision to 2.50. Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
* | libblkid: (ntfs) fix cluster size checkKarel Zak2018-05-251-1/+1
|/ | | | | Addresses: https://github.com/karelzak/util-linux/issues/641 Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: (ntfs) enlarge cluster limit to 2MBKarel Zak2018-05-251-4/+8
| | | | | | | | | | Windows 10 Creators edition has extended the ntfs cluster limit to 2MB. As a consequence blkid does not identify recent partitions with clusters beyond 65K as ntfs ones. Addresses: https://github.com/karelzak/util-linux/issues/641 Signed-off-by: Karel Zak <kzak@redhat.com> Co-Author: Jean-Pierre André <jean-pierre.andre@wanadoo.fr>
* libblkid: (zfs) fix compiler warning [-Wmaybe-uninitialized]Karel Zak2018-05-031-1/+1
| | | | | Reported-by: L A Walsh <lkml@tlinx.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add BitLocker detectionKarel Zak2018-04-245-0/+199
| | | | | | | | | | | | | Supported: * WinVista version * Win7 and later versions (based on NTFS) * BitLockerToGo (for removable media; based on FAT32) Unfortunately, it's without LABEL and UUID. It seems BitLocker does not use volume_label and volume_serial stuff from NTFS header. Addresses: https://github.com/karelzak/util-linux/issues/617 Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: (hfs) check allocation sizeKarel Zak2018-04-121-0/+9
| | | | | | | | | The current prober is based on signature only (two bytes!). It seems pretty fragile. Linux kernel also checks for allocation size in the superblock, let's use it too... it's better than nothing. Reported-by: Milan Broz <gmazyland@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'master' of https://github.com/pali/util-linuxKarel Zak2018-03-271-5/+7
|\ | | | | | | | | | | | | * 'master' of https://github.com/pali/util-linux: tests: Add tests for FAT32 labels blkid: Encode any field which starts with LABEL in same way as LABEL field libblkid: vfat: Change parsing label in special cases
| * libblkid: vfat: Change parsing label in special casesPali Rohár2017-11-251-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* | libblkid: ignore private Stratis devicesTony Asleson2018-03-092-3/+3
| | | | | | | | | | | | | | | | [kzak@redhat.com: - tiny coding style changes] References: 20e1c3dc03399d6988ef35dedc1364cfc12e9263 Signed-off-by: Tony Asleson <tasleson@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | libblkid:(dos) make subtypes probing more robustKarel Zak2018-02-271-7/+18
| | | | | | | | | | | | | | | | | | The current code mix partitions as defined on disk with partitions from partlist (as recognized by libblkid). It seems better to follow partlist only. Reported-by: Vaclav Dolezal <vdolezal@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | libblkid: (mpool) checksum is LEKarel Zak2018-02-261-1/+1
| | | | | | | | | | Reported-by: Ruediger Meier <ruediger.meier@ga-group.nl> Signed-off-by: Karel Zak <kzak@redhat.com>
* | libblkid: (mpool) don't use gtkdocs-like comment blockKarel Zak2018-02-211-3/+1Star
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | misc: fix typos using codespellRuediger Meier2018-02-162-3/+3
| | | | | | | | | | | | Some more funny typos, please review carefully. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | libblkid: make mpool independent on libuuidKarel Zak2018-02-131-3/+1Star
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | misc: remove %p from debug messagesKarel Zak2018-02-012-26/+25Star
| | | | | | | | | | | | From libs where suid program may be executed by non-root user. Signed-off-by: Karel Zak <kzak@redhat.com>
* | libblkid: atari - reject devices with blocksize != 512Vaclav Dolezal2018-01-301-0/+4
| | | | | | | | Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* | libblkid: atari - don't add duplicate entriesVaclav Dolezal2018-01-241-1/+8
| | | | | | | | | | | | This should protect against looped XGMs. Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* | libblkid: atari - test if any partition fits disk sizeVaclav Dolezal2018-01-241-3/+9
| | | | | | | | Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* | libblkid: atari - fix bad variable nameVaclav Dolezal2018-01-241-1/+1
| | | | | | | | Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* | libblkid: Support for Atari partitioning schemeVaclav Dolezal2018-01-234-1/+263
| | | | | | | | | | Addresses: https://github.com/karelzak/util-linux/issues/517 Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* | build-sys: remove redundant EXTRA_DIST filesRuediger Meier2018-01-222-3/+2Star
| | | | | | | | | | | | | | The sources of AC_CONFIG_FILES (*.in) are automatically distributed. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | build-sys: avoid using prog_DEPENDENCIESRuediger Meier2018-01-221-3/+1Star
| | | | | | | | | | | | | | Use EXTRA_prog_DEPENDENCIES to have the benefit of automake's automatic prog_DEPENDENCIES. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | build-sys: remove unneeded dependencies on bla.h.inRuediger Meier2018-01-221-2/+1Star
| | | | | | | | | | | | | | | | | | | | We have already automakes's automatic dependencies like bla.h.in -> bla.h -> foo.o -> bar.la An explicit direct dependency bla.h.in -> bar.la is redundant and useless anyways. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | build-sys: automake is able to find headers in builddir ...Ruediger Meier2018-01-221-1/+1
| | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | build-sys: remove generated headers from dist tar ballRuediger Meier2018-01-221-2/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | Headers should only be listed in either *_HEADERS or *_SOURCES, especially when we want nodist_*_HEADERS. Since all the generated headers are made by configure we don't even need to use BUILT_SOURCES or other tricks. Also see automake docs 9.4.1 Built Sources Example: case "Build bindir.h from configure" Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | include/debug: introduce __UL_INIT_DEBUG_FROM_STRING()Karel Zak2018-01-171-1/+1
| | | | | | | | | | | | | | Let's make it possible to use debug.h without environment variables. Suggested-by: J William Piggott <elseifthen@gmx.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | include/debug: don't print pointer address for SUID programsKarel Zak2018-01-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * introduce new flag __UL_DEBUG_FL_NOADDR to suppress pointer address printing * use __UL_DEBUG_FL_NOADDR when SUID * move ul_debugobj() to debugobj.h, and require UL_DEBUG_CURRENT_MASK to provide access to the current mask from ul_debugobj(). It's better than modify all ul_debugobj() calls and use the global mask as argument. * remove never used UL_DEBUG_DEFINE_FLAG Reported-by: halfdog <me@halfdog.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* | libblkid: Add support for stratisTony Asleson2018-01-114-0/+108
| | | | | | | | | | | | | | | | | | | | Initial support for stratis, ref. https://github.com/stratis-storage [kzak@redhat.com: - remove C++ comment] Signed-off-by: Tony Asleson <tasleson@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | libblkid: (bcache) cleanup magic string definitionKarel Zak2017-12-181-12/+8Star
| | | | | | | | | | Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>