Commit Graph

13454 Commits

Author SHA1 Message Date
Karel Zak 4de60aecad build-sys: release++ (v2.34-rc2)
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-30 12:06:50 +02:00
Karel Zak f26ed90583 docs: update v2.34-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-30 12:01:36 +02:00
Karel Zak 0731ab5498 docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-30 11:58:26 +02:00
Karel Zak c7033bbb12 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-30 11:54:20 +02:00
Božidar Putanec 18c630a27e po: update hr.po (from translationproject.org) 2019-05-30 11:49:43 +02:00
Karel Zak 9db442e954 libmount: add selinuxfs between pseudo filesystems
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1714826
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-29 18:04:57 +02:00
Karel Zak 0e36d7c271 libmount: add bpf between pseudo filesystems
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1714826
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-29 18:01:04 +02:00
Karel Zak 21d93094d4 findmnt: fix filters use on --list
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1714826
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-29 17:59:33 +02:00
Karel Zak bb272bb85e tests: add asan build-sys test
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-29 13:22:01 +02:00
Karel Zak b0eca21a5c fdisk: add note about -S and -H
It's seems people still follow old advices for SSD/4K devices. Let's
make CHS deprecation more visible at the begin of the man page...

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-28 15:12:31 +02:00
Karel Zak b8b7f4745c ul: make sure buffers are zeroized [coverity scan] 2019-05-28 13:33:03 +02:00
Karel Zak dd45b90eef column: make code more robust [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-28 13:25:15 +02:00
Karel Zak da14a74df9 setpriv: fix memory leak in local scope [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-28 13:11:14 +02:00
Karel Zak cf5debba06 setarch: avoid NULL dereference [coverity check]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-28 13:08:21 +02:00
Karel Zak d3149a8556 rtcwake: terminate mode and excl[]
* terminate string read from /proc
* terminate array for exclusive options

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-28 12:53:58 +02:00
Karel Zak 5348fa7d88 build-sys: add info about ASAN
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-28 12:37:14 +02:00
Karel Zak 9f74aa07d4 renice: make code more readable for static analyzer [coverity scan]
It seems coverity and clag have no clue about relation between argv[]
and argc. Let's make code more readable for them...

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-28 12:19:23 +02:00
Karel Zak 517debc389 readprofile: be more explicit with used types [cppcheck]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-28 12:17:26 +02:00
Karel Zak a066140713 lscpu: check scols_line_set_data() return value [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-28 12:05:03 +02:00
Karel Zak fe2e38f3b1 lscpu: make lookup() use more consistent [coverity scan]
We usually check lookup() return value. Let's do it in this case too.
It seems static analyzers will be happy with consistent code.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-28 11:58:51 +02:00
Karel Zak 2c864ba8fc mesg: avoid 'ttyname failed: Success' message
The ttyname(3) can fail to access /dev/ path, and that will cause function
to fail without setting errno value with result of rather confusing error
message.  Lets start setting stdin permission via /proc when this happens as
a go-around, with hope kernel following symlink does not fail.  Ok, noted,
that hopes of symlink follow working are pretty slim.

Based on patch from Sami Kerola <kerolasa@iki.fi>.

Reference: https://github.com/lxc/lxd/issues/1724
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-27 13:07:12 +02:00
Karel Zak a6d9d23b5f lib/ttyutils: introduce get_terminal_stdfd()
Let's use separate function to detect what is the current terminal.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-27 12:49:12 +02:00
Sami Kerola ebd13d3fc5 libblkid: remove unneeded fields from struct bcache_super_block
This started as fix to following warning.

    libblkid/src/superblocks/bcache.c:33:3: warning: ISO C99 doesn’t
    support unnamed structs/unions [-Wc99-c11-compat]

But when sent to review Karel told out rather than getting rid of warnings
lets get rid of everything unnecessary.

[kzak@redhat.com: - use original struct member names rather than 'padN']

Reference: https://github.com/karelzak/util-linux/pull/802
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-27 11:58:13 +02:00
Karel Zak 9c6167c394 login: retire use of __FUNCTION__ macro
This fixes following warning about deprecatd __FUNCTION__ that is another
name for __func__ since GCC (pre 2.95, released July 1999).

    login-utils/login.c:860:10: warning: ISO C does not support
    ‘__FUNCTION__’ predefined identifier [-Wpedantic]

Co-Author: Sami Kerola <kerolasa@iki.fi>
Reference: https://c0x.coding-guidelines.com/6.4.2.2.html
Reference: https://github.com/karelzak/util-linux/pull/802
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-27 11:55:19 +02:00
Karel Zak e4c6816cc3 ipcs: check return value when read from /proc [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-23 15:32:59 +02:00
Karel Zak 226fdcf069 hwclock: don't use uninitialized value [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-23 15:28:07 +02:00
Karel Zak edf9c218c1 fallocate: make posix_fadvise() use more readable for analyzers
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-23 15:17:16 +02:00
Karel Zak 2d27898844 dmesg: make strtok() use more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-23 14:18:29 +02:00
Karel Zak 106bd306a4 blkzone: remove never read value
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-23 13:57:35 +02:00
Karel Zak a2761af42b whereis: make subdirs scan more robust
* call strchr() only once
* avoid things like strcat(buf, strchr(dir, '*') + 1)
* make it more readable
* improve debug messages

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-23 13:53:00 +02:00
Karel Zak 106e696064 lsblk: make sure __process_one_device() has proper arguments [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-23 12:36:53 +02:00
Karel Zak 74152bf944 lsblk: check ul_path_scanf() return value [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-23 12:31:49 +02:00
Karel Zak 404eef654a lsblk: check stat() return code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-23 12:28:13 +02:00
Karel Zak 7241dda191 logger: make code more robust for static analyzer [clang scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-23 12:14:10 +02:00
Karel Zak ac255c2b14 hardlink: avoid uninitialized variables [clang scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-23 12:12:07 +02:00
Sami Kerola 620851e0cc
libfdisk: assert if self_pte() returns NULL
The self_pte() can return NULL if partitions array is not large enough,
but that should also be impossible and definitely a bug.

libfdisk/src/dos.c:984:8: warning: potential null pointer dereference [-Wnull-dereference]
libfdisk/src/dos.c:1031:8: warning: potential null pointer dereference [-Wnull-dereference]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-05-22 19:45:54 +01:00
Karel Zak 04d0701ea8 libfdisk: (bsd) improve checksum calculation [-Waddress-of-packed-member]
Let's keep compilers and static analyzers happy. The idea is to use
memcpy() to copy from buffer to variable and use all label as unsigned
char rather than vectorize by unsigned short.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-22 17:47:04 +02:00
Karel Zak 16d7868fc1 libblkid: (silicon raid) improve checksum calculation [-Waddress-of-packed-member]
Let's keep compilers and static analyzers happy. The idea is to use
memcpy() to copy from buffer to variable and use all label as unsigned
char rather than vectorize by uint16_t.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-22 17:46:14 +02:00
Karel Zak 1a56f15b0f libfdisk: (sgi) improve checksum calculation [-Waddress-of-packed-member]
Let's keep compilers and static analyzers happy. The idea is to use
memcpy() to copy from buffer to variable and use all label as unsigned
char rather than vectorize by uint32_t.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-22 17:42:48 +02:00
Karel Zak 34b0a305f6 include/c: use __has_attribute
The __has macros are more portable (supported by gcc as well as
clang).

The old __GNUC_PREREQ is deprecated and it should be removed in
future. (Well, the __has macros are supported since gcc 5, so we
should be patient as some old stable distros (e.g. RHEL 7) use gcc
4.x).

This patch helps clang to correctly analyze our xalloc.h stuff.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-21 16:27:17 +02:00
Sami Kerola 2e56aa3c3b
bash-completion: add hardlink completion
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-05-20 19:56:19 +01:00
Sami Kerola ba5e7b7e52
bash-completion: update options before release
blkid: 5e91d5dd71 --no-part-details
lsblk: dc4662f0e7 --dedup
lsblk: 0bd05f5ee4 --merge
lscpu: 0e86bc8406 --caches
lscpu: 2011528bce --bytes

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-05-20 19:43:59 +01:00
Karel Zak 8ecc6ba807 lib/ismounted: use xstrncpy()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-20 13:03:58 +02:00
Karel Zak 380fe6ac46 zramctl: use xstrncpy()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-20 12:59:40 +02:00
Karel Zak aa75c5eb74 whereis: use xstrncpy()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-20 12:59:02 +02:00
Karel Zak 124a903002 vipw: use xstrncpy()
It's already used by vipw, so use it everywhere.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-20 12:57:39 +02:00
Karel Zak e2569bcf26 lib/path: use xstrncpy()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-20 12:57:16 +02:00
Karel Zak 94d9fd9f6a lib/sysfs: use xstrncpy()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-20 12:57:07 +02:00
Karel Zak 91072cd480 losetup: use xstrncpy()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-20 12:46:39 +02:00
Karel Zak 9f34182d53 sfdisk: use xstrcpy()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-20 12:42:43 +02:00