summaryrefslogtreecommitdiffstats
path: root/libblkid/src/verify.c
Commit message (Collapse)AuthorAgeFilesLines
* libblkid: fix compiler warning [-Wimplicit-function-declaration]Karel Zak2014-06-181-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: add sysfs_devno_is_lvm_private() from libblkidKarel Zak2014-06-171-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: ignore private LVM devicesKarel Zak2014-06-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The virtual private LVM devices do not contain any blkid relevant data and it does not make any sense to scan for superblocks or partitions on the devices, because we can interpret data from the devices in bad way. Unfortunately, for LVM has "private" very special meaning. The private LVM devices are accessible and readable (according to LVM guys it's feature, because debugging etc.). The problem is pretty visible with LVM thin provisioning where a virtual pool device contains segments from the top-level thin devices. Mountable top-level LVM-thin device: # blkid -o udev -p /dev/mapper/vg-thin1 ID_FS_UUID=57ed6490-903b-416c-91d2-6d06804ec60c ID_FS_TYPE=ext4 Virtual private LVM-pool device (contains data from all thin devices): # blkid -o udev -p /dev/mapper/vg-pool0 ID_FS_UUID=57ed6490-903b-416c-91d2-6d06804ec60c ID_FS_TYPE=ext4 ... this is incorrect, vg-pool0 is unmountable. LVM uses special UUID suffixes for private devices. All devices with uuid in format "LVM-<uuid>-<type>" are private. This patch modifies libblkid to not scan such devices. The high-level API ignores such devices at all now. The low-level API allows to assign the device to blkid_prober, but all scan functions always return nothing and library does not read anything from the device. The another functionality (get parental device, topology, sector sizes, etc.) still works as expected. The change affects only probing code. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1101345 Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use new debug functionsKarel Zak2014-03-211-6/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: clean up DBG()Karel Zak2013-04-081-13/+10Star
| | | | | | | | | - use stderr only - use BLKID_ prefix for debug masks - don't use \n in in messages and don't use printf(), but use generic blkid_debug(). Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: Expose more ISO9660 headersZeeshan Ali (Khattak)2013-02-141-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to kill libosinfo's infamous udev rule[1], we need to make blkid report the following information as udev properties on IS09660 media so that libosinfo can make use of that for detection: 1. Volume ID (already exposed as label). 2. System ID. 3. Publisher ID. 4. Application ID. 5. Boot record's boot system ID, (almost always 'EL TORITO SPECIFICATION' if boot record is present). Example use: $ blkid -p -o udev Fedora-17-x86_64-DVD.iso ID_FS_SYSTEM_ID=LINUX ID_FS_APPLICATION_ID=GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE ID_FS_UUID=2012-05-22-20-55-32-00 ID_FS_UUID_ENC=2012-05-22-20-55-32-00 ID_FS_BOOT_SYSTEM_ID=EL TORITO SPECIFICATION ID_FS_LABEL=Fedora_17_x86_64 ID_FS_LABEL_ENC=Fedora\x2017\x20x86_64 ID_FS_TYPE=iso9660 ID_PART_TABLE_TYPE=dos [1] https://fedorahosted.org/libosinfo/ticket/1 [kzak@redhat.com: - add blkid_ltrim_whitespace() and use it together with blkid_rtrim_whitespace() to trim white spaces - enlarge blkid values to 128 bytes - add generic blkid_probe_set_id_label() function - always terminate all _ID with \0 - don't export the _IDs to blkid cache] Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: remove optimization from verify( funrtionKarel Zak2013-02-011-65/+11Star
| | | | | | | | | | | | | | | | Now libblkid (the cache based part) tries to probe for the cached filesystem firstly. This optimization is broken, because: * new another superblock could be on the device and the original is already obsolete * we still need to probe for partitions and raids * the code was too fragile The patch also suggests lsblk --fs in blkid.8 for end users. lsblk read information from used db. Reported-by: Andreas Hofmeister <andi@collax.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: re-read PART{UUID,LABEL} for successfully verified cached devicesKarel Zak2012-12-041-5/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: cleanup arguments checksKarel Zak2012-12-041-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: remove obsolete tags from cacheKarel Zak2012-11-141-0/+20
| | | | | | | | | | | | | | | | | The libblkid cache tags are not removed if a new version of the tags is empty (e.g. label 'foo' -> ''). # mkfs.ext4 -L test_label /dev/sda15 # blkid /dev/sda15 /dev/sda15: LABEL="test_label" # tune2fs -L '' /dev/sda15 # blkid /dev/sda15 /dev/sda15: LABEL="test_label" ^^^^^^^^^^ Reported-by: Mike Fleetwood <mike.fleetwood@googlemail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use O_CLOEXECKarel Zak2012-09-041-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add support for PARTUUID= and PARTLABEL=Karel Zak2012-04-191-1/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: use %m in format string instead of %s and strerror(errno)Petr Uzel2011-09-271-4/+4
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* build-sys: use top-level directory for libblkid rather than shlibs/blkidKarel Zak2011-06-091-0/+231
Signed-off-by: Karel Zak <kzak@redhat.com>