summaryrefslogtreecommitdiff
path: root/misc-utils/blkid.c
AgeCommit message (Collapse)AuthorFilesLines
2013-11-08blkid: simple typoPhillip Susi1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-07blkid: escape quotes in the outputKarel Zak1-4/+8
# e2label /dev/loop0 'La"bel' # blkid -p /dev/loop0 /dev/loop0: LABEL="La"bel" .... new version: /dev/loop0: LABEL="La\"bel" .... Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-06-13blkid: export ID_PART_TABLE_UUIDKarel Zak1-0/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-14blkid: fix typo in ID_FS_AMBIVALEN=Karel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-26blkid, hwclock, ldattach: use program_invocation_short_nameSami Kerola1-3/+1
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-10blkid: use xalloc everywhereKarel Zak1-22/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-03blkid: use O_CLOEXECKarel Zak1-1/+1
... to make "strace -e open blkid" for libblkid stuff without exceptions. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-26blkid: use xalloc.h when possibleSami Kerola1-4/+5
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-03-20blkid: also accept -V for displaying version informationBenno Schulenberg1-2/+3
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-25textual: standardize reporting of program name plus package versionBenno Schulenberg1-2/+3
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2012-12-12blkid: fix double free [coverity scan]Karel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-26blkid: fix shadow declarationSami Kerola1-4/+4
misc-utils/blkid.c:402:15: warning: declaration of 'usage' shadows a global declaration [-Wshadow] misc-utils/blkid.c:63:13: warning: shadowed declaration is here [-Wshadow] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-07-26blkid: use err_exclusive_options()Karel Zak1-8/+10
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-17blkid: use exclusive_option()Sami Kerola1-8/+12
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-11blkid: fix realloc memory leak [cppcheck]Sami Kerola1-1/+3
[misc-utils/blkid.c:367]: (error) Common realloc mistake: 'str' nulled but not freed upon failure Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-05-23blkid: stop device probing if error is detectedPetr Uzel1-1/+4
blkid -p dev1 dev2 [...] now stops upon first error detected and returns correct value. Previously, if error was detected with dev1, it continued with dev2 anyways and so the return value corresponded to the last device only. Reported-by: Bernhard Voelker <bernhard.voelker@siemens-enterprise.com> Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-23blkid: introduce symbolic names for different blkid exit codesPetr Uzel1-14/+18
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-23blkid: use symbolic exit codePetr Uzel1-1/+1
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-15misc-utils: cleanup strtoxx_or_err()Karel Zak1-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-15include/ttyutils: more robust get_terminal_width()Karel Zak1-2/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-15blkid: use get_terminal_width() from ttyutils.hPetr Uzel1-28/+1
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-04-23Fix typos found by misspellingsBernhard Voelker1-1/+1
The tool misspellings (https://github.com/lyda/misspell-check) detected several typos. Command used: $ git ls-files | grep -v ^po/ | misspellings -f - * isosize: Fix typo in usage string. * configure.ac: Fix typo in help string of --enable-most-builds option. * fdisk: Fix typo in man page. * libblkid, blkid, mount: Likewise. * Fix various typos in docs and in source code comments. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2012-04-04misc-utils: verify writing to streams was successfulSami Kerola1-0/+2
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30blkid: use strtosize_or_err()Karel Zak1-8/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-26docs: mark udev and list blkid(8) output formats deprecatedKarel Zak1-4/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-02blkid: add DEVNAME= to export output formatKarel Zak1-0/+2
Reported-by: Balamurugan Arumugam <barumuga@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-02-02blkid: remove dead assigmentKarel Zak1-1/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-01-31blkid: add comment to keep static analysers happyKarel Zak1-0/+1
2012-01-31blkid: check fd before use [coverity scan]Karel Zak1-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-01-25blkid: move cache to /run on new systemsKarel Zak1-1/+2
Why? * read-only root * /etc is pretty bad place for caches * all is usually cached by udev in /dev/disk/by-* and libblkid is able to use these symlinks * boot persistent cache is attractive for very small subset of Linux machines (and they already need extra udev tunning otherwise udev will probe all block devices during boot) * the default is possible to override in /etc/blkid.conf The systems without /run directory will not be affected by this change. Signed-off-by: Karel Zak <kzak@redhat.com>
2012-01-25blkid: remove -w option from man page and usage() outputKarel Zak1-9/+2
The option does not have any effect, the original functionality was removed from e2fsprogs in year 2003 by commit 50b380b4d4ab668bad45033e3a8aaf93c7f42844 git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git So.. don't propagate the option to users in year 2012 :-) Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-21blkid: print ID_PART_ENTRY_* for small devicesKarel Zak1-5/+3
The current optimization for small devices (1.4MiB) is broken. It checks for partition table, but if nothing is detected then details (ID_PART_ENTRY_*) about the current partition are not gathered. The optimization should be enabled for small *whole* disks only. Reported-by: David Zeuthen <davidz@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-27misc: use %m in format string instead of %s and strerror(errno)Petr Uzel1-1/+1
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2011-09-12blkid: potential null derefence [smatch scan]Karel Zak1-3/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-16blkid: fix typoKarel Zak1-3/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-16blkid: indent usage()Karel Zak1-27/+27
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-01blkid: fix compiler warnings [-Wunused-parameter]Karel Zak1-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-06-20blkid: list all known filesystems/RAIDs (add -k option)Karel Zak1-1/+11
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-06-08blkid: don't free() uninitialized variableKarel Zak1-1/+1
blkid.c: In function ‘main’: blkid.c:656:6: warning: ‘res’ may be used uninitialized in this function [-Wuninitialized] blkid.c:623:9: note: ‘res’ was declared here Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-29blkid: small fix for safe_print()Sergey Gusarov1-1/+1
This small fix makes it possible to print the first unprintable character with code 128 from ASCII table. Signed-off-by: Sergey Gusarov <laborer2008@gmail.com>
2011-03-29blkid: add -d option to print non-printable charsKarel Zak1-8/+16
Reported-by: laborer2008 laborer <laborer2008@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-11blkid: fix double free [coverity scan]Karel Zak1-3/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-08blkid: don't ignore -iKarel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-08blkid: uniformize the synopsis, remove "the the"Benno Schulenberg1-5/+5
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-02-08blkid: dynamically allocate devicename arrayEric Sandeen1-1/+12
If more than 128 devices are specified on the blkid cmdline, the devices[] array will overflow. We can dynamically allocate the devices[] array based on number of arguments to avoid this problem. [kzak@redhat.com: - add "if (optind < argc)" check] Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2011-02-03blkid: add new return code 8 for ambivalent low-level probing resultKarel Zak1-1/+7
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-02-03blkid: don't return PART_ENTRY_* if partition is emptyKarel Zak1-0/+14
The PART_ENTRY_* has nothing to do with the _contents_ of the block device. So if the device is empty these values should not be printed and blkid(8) has to return 2. The PART_ENTRY_* for empty devices should be printed for "-o udev" output only. Reported-by: Thomas Bächler <thomas@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2011-02-03blkid: don't print devname if nothing detectedKarel Zak1-2/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-23lib: [strutils] general purpose string handling functionsDavidlohr Bueso1-1/+1
This patch replaces a few functions used throughout the source: * Renames getnum (from schedutils) to strtol_or_err * Moves strtosize (from lib/strtosize.c) * Moves xstrncpy (from include/xstrncpy.h) * Adds strnlen, strnchr and strndup if not available (remove it from libmount utils) A few Makefile.am files were modified to compile accordingly along with trivial renaming in schedutils source code. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-06-02blkid: remove _ENC from ID_PART_ENTRY_{NAME,TYPE} variablesKarel Zak1-4/+1
The *_ENC variables are deprecated. All stuff for udev should be encoded. Reported-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Karel Zak <kzak@redhat.com>