summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | lib/path: fix possible NULL dereferencing [coverity scan]Karel Zak2019-05-151-2/+4
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | lib/path: fix ul_path_get_dirfd() usage [coverity scan]Karel Zak2019-05-151-1/+5
| | | | | | | | | | | | ul_path_get_dirfd() returns negative number on error... Signed-off-by: Karel Zak <kzak@redhat.com>
* | lib/path: consolidate ul_path_mkpath() usageKarel Zak2019-05-151-74/+28Star
| | | | | | | | | | | | | | * always use errno from ul_path_mkpath() * keep code simple and short as possible Signed-off-by: Karel Zak <kzak@redhat.com>
* | lib/path: fix possible NULL pointer dereferencing [coverity scan]Karel Zak2019-05-151-0/+3
|/ | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: fix "maybe be" duplicationAustin English2019-05-151-1/+1
| | | | Signed-off-by: Austin English <austinenglish@gmail.com>
* rtcwake: fix "maybe be" duplicationAustin English2019-05-151-2/+2
| | | | Signed-off-by: Austin English <austinenglish@gmail.com>
* mount: fix "maybe be" duplicationAustin English2019-05-151-4/+4
| | | | Signed-off-by: Austin English <austinenglish@gmail.com>
* lsblk: fix "maybe be" duplicationAustin English2019-05-151-3/+3
| | | | Signed-off-by: Austin English <austinenglish@gmail.com>
* libmount: fix "maybe be" duplicationAustin English2019-05-151-1/+1
| | | | Signed-off-by: Austin English <austinenglish@gmail.com>
* lib/colors: fix "maybe be" duplicationAustin English2019-05-151-1/+1
| | | | Signed-off-by: Austin English <austinenglish@gmail.com>
* losetup: keep static analyzer happy [coverity scan]Karel Zak2019-05-141-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/colors: keep static analyzer happy [coverity scan]Karel Zak2019-05-141-2/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/canonicalize: verify DM paths [coverity scan]Karel Zak2019-05-141-1/+1
| | | | | | | | | | | | | Now the code only checks that /sys/.../dm/name exists, but never verify the device node in /dev (because path prefix is never NULL). The prefix is used to redirect hardcoded paths to /sys dumps (e.g. lsblk regression tests, etc.) This bug has been introduced in v2.33. Fortunately, it's probably no big issue as /dev is always in sync with /sys (thanks to udevd). Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add PKG_INSTALLDIR fallbackKarel Zak2019-05-141-0/+24
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: initialize buffers for get_user_reply() [coverity scan]Karel Zak2019-05-143-5/+5
| | | | | | It's probably unnecessary, but better be safe than sorry. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add --with-pkgconfigdirKarel Zak2019-05-142-2/+1Star
| | | | | | | | | | | | | | | | | It seems we need a way how to override the default pkg-config install directory. default: $ ./configure $ grep 'pkgconfigdir =' Makefile pkgconfigdir = ${usrlib_execdir}/pkgconfig user-defined: $ ./configure --with-pkgconfigdir=/usr/share/pkgconfig $ grep 'pkgconfigdir =' Makefile $ pkgconfigdir = /usr/share/pkgconfig Addresses: https://github.com/karelzak/util-linux/issues/793 Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: Set BLKID_BID_FL_VERIFIED in case revalidation is not neededNikolay Borisov2019-05-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | If blkid_verify deems that device revalidation is not needed since BLKID_PROBE_MIN seconds haven't elapsed since the last revalidation of the device it returns a blkid_dev. However, if this device has been read from the cache file on disk then it wont' have BLKID_BID_FL_VERIFIED bit set. This in turn could lead to a later call to blkid_dev_get free this device in case its part of a multi device configuration. This is particularly relevant to btrfs raid configurations. Namely this was exhibited by btrfs-progs which use blkid for device enumeration. In case of a multi-device filesystem (i.e raid10) running xfstest btrfs/011 would fail sporadically since cached devices read from cache were not revalidated due to being recently validated (according to timestamp in the cache file) at the same time their in-memory blkid_dev structures didn't have BLKID_BID_FL_VERIFIED set. This lead to their untimely removal from the cache from blkid_get_dev. Fix this by setting the BLKID_BID_FL_VERIFIED when returning from blkid_verify with a valid device irrespective of whether full revalidation was performed or the device is deemed valid due to being recently validated. [kzak@redhat.com: - remove also check for BLKID_BID_FL_VERIFIED, the function needs to check for elapsed time only] Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: Don't check BLKID_PROBE_INTERVAL in blkid_verifyNikolay Borisov2019-05-141-2/+1Star
| | | | | | | | | | That constant is set to 200 seconds and is already check in probe_all(). It essentially controls how often blkid_probe_all can do a full cache revalidation. Since blkid_verify is called from within probe_all() iff at least BLKID_PROBE_INTERVAL seconds have elapsed it makes no sense to check this value in blkid_verify. Signed-off-by: Nikolay Borisov <nborisov@suse.com>
* lib/strutils: parse_size() fix frac digit calculationKarel Zak2019-05-131-10/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Old code: ./test_strutils --size 0.5MiB 0.5MiB : 512000 : 500K : 500 KiB ./test_strutils --size 0.50MiB 0.50MiB : 5120000 : 4.9M : 4.9 MiB New code: ./test_strutils --size 0.5MiB 0.5MiB : 524288 : 512K : 512 KiB ./test_strutils --size 0.50MiB 0.50MiB : 524288 : 512K : 512 KiB Note that the new implementation also does not use float points, because we need to support PiB and so on... it seems good enough for things like: ./test_strutils --size 7.13G 7.13G : 7656104581 : 7.1G : 7.1 GiB ./test_strutils --size 7.16G 7.16G : 7690675814 : 7.2G : 7.2 GiB to avoid situation where cfdisk creates partition with completely crazy numbers. Addresses: https://github.com/karelzak/util-linux/issues/782 Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/strutils: parse_size() fix frac with zerosKarel Zak2019-05-131-7/+12
| | | | | | Fix 0.001G as well as accept 0.000G as valid number. Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim: affect only warnings by --quietKarel Zak2019-05-092-6/+11
| | | | | | | | We need the same return code from fstrim_filesystem() independently on --quiet command line option. Addresses: https://github.com/karelzak/util-linux/pull/791 Signed-off-by: Karel Zak <kzak@redhat.com>
* bash-completion: add fstrim --quietKarel Zak2019-05-091-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'fstrim-bug-789' of https://github.com/kerolasa/util-linuxKarel Zak2019-05-093-6/+31
|\ | | | | | | | | * 'fstrim-bug-789' of https://github.com/kerolasa/util-linux: fstrim: add --quiet option to suppress error messages
| * fstrim: add --quiet option to suppress error messagesSami Kerola2019-05-073-6/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | When fstrim interacts with NTFS it result can be error reporting bad file descriptor. That seems to be a bug in NTFS. While waiting driver to get on top of the issue and be commonly available lets add to fstrim option to make it be more silent about errno 9 aka EBADF, Bad file descriptor. Reported-by: https://github.com/moviuro Proposed-by: Dave Reisner <dreisner@archlinux.org> Reference: https://bugs.archlinux.org/task/62288 Addresses: https://github.com/karelzak/util-linux/issues/789 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | libmount: return errno on failed fstab stat()Karel Zak2019-05-091-2/+3
|/ | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use __SANITIZE_ADDRESS__ rather than custom USE_CLOSE_ATEXITKarel Zak2019-05-072-4/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/loopdev.c: Retry LOOP_SET_STATUS64 on EAGAINRomain Izard2019-05-071-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A recent bugfix in the Linux kernel made it possible for the LOOP_SET_STATUS64 ioctl to fail when called with a non-zero offset, with an EAGAIN errno: 5db470e229e2 loop: drop caches if offset or block_size are changed This fix changes a silent failure (where mount could sometimes access the backing loop image through the cache without the specified offset) to an explicit failure, and it has also been backported on stable branches. On a 5.0 kernel, other changes to the loop driver make it hard to get generate the EAGAIN error, but this bugfix has also been backported to stables branches, without these changes. At least with the 4.14 stable branch, the EAGAIN error can be quickly generated with the following loop: while mount -o loop,offset=239 disk point && umount point; do :; done Retry the ioctl when it fails with EAGAIN, which means that mount or losetup will eventually succeed when encountering this case. [kzak@redhat.com: - use our local portable xusleep()] Signed-off-by: Romain Izard <romain.izard.pro@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: use scols_walk_* for calculations and printingKarel Zak2019-05-072-99/+67Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add generic function to walk on treeKarel Zak2019-05-073-1/+195
| | | | | | | Now we implement the same thing on more places. Let's add one set of functions to walk the tree and use it everywhere. Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: fix heap-use-after-freeKarel Zak2019-05-061-0/+1
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/787 Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: cell width calulation cleanupKarel Zak2019-05-032-36/+49
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: (groups) use print functions tp calculate grpsetKarel Zak2019-05-034-75/+23Star
| | | | | | | Now we have extra code to calculate grpset. It seems better to use only one way how we wall the tree. Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: (groups) print group childrent after regualr treeKarel Zak2019-05-033-28/+72
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: (groups) improve debug messagesKarel Zak2019-05-032-2/+14
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: add more debug messagesKarel Zak2019-05-021-5/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: fix groups reset, add debugsKarel Zak2019-05-023-12/+29
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: (groups) remove hardcoded const numbersKarel Zak2019-05-023-15/+20
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hardlink: fix compiler warnings [-Wsign-compare -Wmaybe-uninitialized]]Karel Zak2019-05-021-3/+3
| | | | | | | | | | misc-utils/hardlink.c: In function ‘process_path’: misc-utils/hardlink.c:287:30: warning: operand of ?: changes signedness from ‘off_t’ {aka ‘long int’} to ‘long unsigned int’ due to unsignedness of other operand [-Wsign-compare] misc-utils/hardlink.c: In function ‘main’: misc-utils/hardlink.c:455:5: warning: ‘exclude_pattern’ may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Karel Zak <kzak@redhat.com>
* hardlink: retire NIOBUF in favour of more common BUFSIZSami Kerola2019-05-011-5/+5
| | | | | | | | | | Reason to retire NIOBUF is that it is obscure local definition, while BUFSIZ is well understood and commonly used constant. Besized sizes of these are not far off, the NIOBUF was 4096 bytes and BUFSIZ tends to be 8192 bytes. Proposed-by: Karel Zak <kzak@redhat.com> Reference: https://github.com/karelzak/util-linux/pull/783 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* hardlink: move global variables to a control structureSami Kerola2019-05-011-68/+78
| | | | | | | | | | Well, sort of. Due to use of ctl values in atexit() print_summary() there is need for global control structure. Secondly couple variables can be moved to more restricted scope, namely the PCRE variables are now in main(). Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* hardlink: use flexible array member rather than zero-size arraySami Kerola2019-05-011-2/+2
| | | | | | | | | This fixes two standards compliancy warnings. hardlink.c:65:7: warning: ISO C forbids zero-size array ‘name’ [-Wpedantic] Reference: https://en.wikipedia.org/wiki/Flexible_array_member Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: release++ (v2.34-rc1)Karel Zak2019-04-302-1/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: update v2.34-ReleaseNotesKarel Zak2019-04-301-0/+427
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: update AUTHORS fileKarel Zak2019-04-291-0/+40
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: build-sys updateKarel Zak2019-04-2918-395/+413
| | | | | | | | | | | | | * libblkid does not depend on libuuid anymore * libncurses depends on libdl due to $ ncursesw6-config --libs -lncursesw -ltinfo -ldl * new command hardlink (with dependence on libpcre2-8 * hwclock needs librt Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: don't use ASAN on XOSKarel Zak2019-04-251-13/+20
| | | | | | | | | | It seems that Apple Clang is not mature enough to use ASAN. AddressSanitizer: detect_leaks is not supported on this platform. Let's disable ASAN on XOS at all. Signed-off-by: Karel Zak <kzak@redhat.com>
* po: merge changesKarel Zak2019-04-2427-49260/+57925
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hardlink: remove \r from outputKarel Zak2019-04-241-13/+3Star
| | | | | | | | | | | * remove \r from internationalized messages * remove \r from all output to make it easy to use (see for example output file from "hardlink -vv --dry-run . &> log") * remove unnecessary formatting stuff from output, just keep is simple and stupid... Signed-off-by: Karel Zak <kzak@redhat.com>
* po: update sv.po (from translationproject.org)Sebastian Rasmussen2019-04-241-303/+283Star
|
* po: update hr.po (from translationproject.org)Božidar Putanec2019-04-241-4737/+4576Star
|