summaryrefslogtreecommitdiffstats
path: root/libblkid/src/read.c
Commit message (Collapse)AuthorAgeFilesLines
* misc: do not use plain 0 as NULL [smatch scan]Sami Kerola2017-02-201-3/+3
| | | | | | | | | | text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer Since many 'struct option' has used zero as NULL make them more readable in same go by reindenting, and using named argument requirements. Reference: https://lwn.net/Articles/93577/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: fix some compiler warningsRuediger Meier2016-10-271-32/+0Star
| | | | | | | | | | libsmartcols/samples/fromfile.c:59:2: warning: passing argument 3 of 'string_to_bitmask' from incompatible pointer type text-utils/pg.c:79:0: warning: "TABSIZE" redefined libblkid/src/read.c:455:13: warning: 'debug_dump_dev' defined but not used [-Wunused-function] libblkid/src/probe.c:769:13: warning: unused function 'cdrom_size_correction' [-Wunused-function] /usr/include/sys/termios.h:3:2: warning: "this file includes <sys/termios.h> which is deprecated, use <termios.h> instead" [-W#warnings] Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* libblkid: don't check nonnull attributes for NULL [-Wnonnull-compare]Karel Zak2016-06-141-3/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: improve debug messagesKarel Zak2016-05-251-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: assume strtoull() is availableSami Kerola2015-01-071-10/+3Star
| | | | | | | | | The strtoull() is part of ISO/IEC 9899:1999 (aka C99) and the function has been happily used in prlimit(1) since 2011-10-19 without anyone complaining compatibility issues. Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/strtoul.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libblkid: care about unsafe chars in cacheKarel Zak2014-11-271-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The high-level libblkid API uses /run/blkid/blkid.tab cache to store probing results. The cache format is <device NAME="value" ...>devname</device> and unfortunately the cache code does not escape quotation marks: # mkfs.ext4 -L 'AAA"BBB' # cat /run/blkid/blkid.tab ... <device ... LABEL="AAA"BBB" ...>/dev/sdb1</device> such string is later incorrectly parsed and blkid(8) returns nonsenses. And for use-cases like # eval $(blkid -o export /dev/sdb1) it's also insecure. Note that mount, udevd and blkid -p are based on low-level libblkid API, it bypass the cache and directly read data from the devices. The current udevd upstream does not depend on blkid(8) output at all, it's directly linked with the library and all unsafe chars are encoded by \x<hex> notation. # mkfs.ext4 -L 'X"`/tmp/foo` "' /dev/sdb1 # udevadm info --export-db | grep LABEL ... E: ID_FS_LABEL=X__/tmp/foo___ E: ID_FS_LABEL_ENC=X\x22\x60\x2ftmp\x2ffoo\x60\x20\x22 Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use new debug functionsKarel Zak2014-03-211-14/+14
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: clean up DBG()Karel Zak2013-04-081-21/+16Star
| | | | | | | | | - 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: use O_CLOEXECKarel Zak2013-04-031-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: remove blkid_{strndup,strdup}Karel Zak2012-11-301-1/+1
| | | | | | | Don't try to be smart. Let's use standard libc functions. (Note that we have fallback for strndup() in include/strutils.h) 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: verify arroy bound before reference [cppcheck]Sami Kerola2012-02-081-1/+1
| | | | | | [libblkid/src/read.c:428]: (style) Array index end is used before limits check Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libblkid: fix use-after-free [coverity scan]Karel Zak2012-01-301-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blkid: move cache to /run on new systemsKarel Zak2012-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* build-sys: check HAVE_ definitions with #ifdef [smatch scan]Sami Kerola2011-12-021-2/+2
| | | | | | Fix to `warning: undefined preprocessor identifier' messages. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: use top-level directory for libblkid rather than shlibs/blkidKarel Zak2011-06-091-0/+498
Signed-off-by: Karel Zak <kzak@redhat.com>