Commit Graph

13574 Commits

Author SHA1 Message Date
Karel Zak 369e4c53a8 libmount: fix docs typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-13 13:45:39 +02:00
Karel Zak 303ff21ea7 rev: be careful with close()
Addresses: https://github.com/karelzak/util-linux/issues/807
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-13 12:59:39 +02:00
Karel Zak f5b7bf155b findmnt: (verify) ignore passno for XFS
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1719069
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-12 11:03:23 +02:00
Karel Zak 4a0e70663c lib/sysfs: fix reference counting for parent
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-11 12:11:32 +02:00
Karel Zak 41994e0097 cfdisk: free libfdisk items
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-11 11:22:39 +02:00
Karel Zak 6466959d9a fstrim: update man page, reuse libmnt_iter
* add info about read-only to the man page
* don't be systemd specific, people aso use crond
* reuse libmnt_iter

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-11 11:05:12 +02:00
Karel Zak 49e1a33346 cfdisk: simplify code
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-11 10:54:22 +02:00
Stanislav Brabec 402006fa6e fstrim: properly de-duplicate fstrim -A
fstab can contain tag based mounts. De-duplication by source has to be
done after resolving the full source path.

Perform the table iteration twice. First time, prepare for
de-duplication, second time perform the TRIM itself.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2019-06-11 10:26:55 +02:00
Stanislav Brabec 2d22ac64e4 fstrim -a/-A: Skip read-only volumes
Calling TRIM on some read-only volumes can fail with:
fstrim: /win: FITRIM ioctl failed: Bad file descriptor

Skipping all read-only mounts seems to be safe and logical strategy.

Fixes opensuse#1106214.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2019-06-11 10:23:45 +02:00
Stanislav Brabec 4080be3d7d fstrim: Fix fstrim_all() comment
"convert LABEL=" does not happens in mnt_fs_get_source(), but later in
mnt_resolve_spec(). To make this more clean, move the comment before this
chunk of code.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2019-06-11 10:23:45 +02:00
Karel Zak 348f57d669 lib/canonicalize: fix compiler warning [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-10 11:00:38 +02:00
Karel Zak 2089538adb libmount: (docs) add reference to v2.33 and v2.34
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-07 12:37:28 +02:00
Karel Zak 36ad92c23e libsmartcols: (docs) add reference to v2.33 and v2.34
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-07 12:32:45 +02:00
Karel Zak cbfd67cfea libfdisk: (docs) add reference to v2.33
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-07 12:30:13 +02:00
Karel Zak bf0a0e3e2a umount: be more strict about --all
If you by accident execute

	umount ls -al /mnt/

then umount --all is executed and another arguments silently ignored.
It seems better to be more strict in this case.

Reported-by: Harald Dunkel <harald.dunkel@aixigo.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-06 14:56:48 +02:00
Karel Zak 33985f1149 wall: make sure ut_line is not empty
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1711574
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-06 12:33:03 +02:00
Milan Broz 73421b953e libblkid: fix detection of dm-integrity superblock version
Kernel 5.2 can use superblock version 3 for dm-integrity.
Let's remove the explicit version check to be compatible
with future extensions.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
2019-06-04 13:04:09 +02:00
Jakub Hrozek 9a1a982206 su: More descriptive error message on malformed user entry
With users coming from LDAP, it is often the case that the entry in LDAP
does not contain one or more attributes required by su or, because of
misconfigured access control rights, the attribute might not be readable
by the LDAP client. In that case, su just tells the user that the user
does not exist.

It might be more user-friendly to tell the user to check the user entry
for all required fields.
2019-05-31 13:23:57 +02:00
Karel Zak f7c5507db6 hardlink: fix bad formatting in hardlink.1
* fix regex\f to regex\fR (issue #805)
* replace \fP with \fR to be consistent with our another man pages

Addresses: https://github.com/karelzak/util-linux/issues/805
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-31 11:57:29 +02:00
Karel Zak 3282593d30 docs: add lscpu --caches to ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-31 11:48:10 +02:00
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