Commit Graph

13519 Commits

Author SHA1 Message Date
Sami Kerola f3aded3fdb
include/xalloc: ensure xstrdup() and xstrndup() returns nonnull attribute
Turned out lsblk is passing null as argument to xstrdup(), so fix that and
add assert() to make sure promise of not returning null is kept in future.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-07-14 11:52:13 +01:00
Sami Kerola 371be858d7
libmount: fix potential null pointer dereference
This is false positive warning, but lets silence it so that if and when
warnings crop up they are easy to notice and take seriously.

libmount/src/optstr.c:354:29: warning: potential null pointer dereference
[-Wnull-dereference]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-07-12 22:09:31 +01:00
Sami Kerola 34813bdd29
libfdisk: fix variable shadowing
libfdisk/src/context.c:678:7: warning: declaration of ‘rc’ shadows a
previous local [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-07-12 21:45:50 +01:00
Sami Kerola 5119ef0a83
lib/ttyutils: avoid checking same thing twice
Check cols and lines are not NULL only once.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-07-01 22:02:06 +01:00
Karel Zak e3bb9bfb76 lsblk: force to print PKNAME for partition
PKNAME (parent kernel device name) is based on printed tree according
to parent -> child relationship. The tree is optional and not printed
if partition specified (.e.g "lsblk -o+PKNAME /dev/sda1"), but old
versions print the PKNAME also in this case.

Addresses: https://github.com/karelzak/util-linux/issues/813
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-27 09:22:18 +02:00
Sanchit Saini cfb9934d5f
TODO: fix typo 2019-06-21 23:21:46 +05:30
Stanislav Brabec d670a3f30b Fix translations for losetup typo fix
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2019-06-21 14:38:33 +02:00
Stanislav Brabec ec06412c90 losetup: Typo fix
Fix a typo in usage introduced in a1a41597bf.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2019-06-21 14:38:32 +02:00
Stanislav Brabec b0853a08db agetty: Remove superfluous fflush()
eval_issue_file() contains fflush(stdout). It comes from an old code that
used fputs() to write to the console.

In the new code, we write to a temporary memstream, and
fclose(ie->output) fully replaces possible fflush(ie->output) in this
implementation.

The new print_issue_file() does not need it as well, as it uses
unbuffered write_all().

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2019-06-21 14:38:32 +02:00
Marcos Mello f1424a9423 libfdisk: fix typos 2019-06-20 08:22:25 -03:00
Karel Zak dab1303287 Revert "lib/loopdev.c: Inline loopcxt_has_device"
... no caller in that file, this change has no effect.

This reverts commit 3bb960c7b5.
2019-06-18 22:05:16 +02:00
Karel Zak 7571ec08a1 libfdisk: add fdisk_assign_device_by_fd()
It's possible that caller has the device already opened for some
other task, so let's reuse the file descriptor.

Requested-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-18 13:30:42 +02:00
Karel Zak fdf62463ce Merge branch 'su_err_msg' of https://github.com/jhrozek/util-linux
* 'su_err_msg' of https://github.com/jhrozek/util-linux:
  su: More descriptive error message on malformed user entry
2019-06-18 11:26:12 +02:00
Karel Zak bddcf5b816 Merge branch 'topic/wdctl' 2019-06-17 15:48:28 +02:00
Karel Zak b3dd29d1b8 wdctl; read from /sys if necessary
The device can be inaccessible for non-root user or busy (already used
by another process). In this case it seems better to read information
from /sys.

Note that /sys does not provide struct watchdog_info.options, so we
cannot print list of supported watchdog features.

Addresses: https://github.com/karelzak/util-linux/issues/804
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-17 15:47:39 +02:00
Karel Zak e3188dd90a lib/path: make sure ul_path_read_buffer() derminate result
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-17 15:47:39 +02:00
Karel Zak 8c8df42146 wdctl: default to /dev/watchdog0
Let's use miscdev /dev/watchdog as fallback only. We need (if possible)
cdev /dev/watchdog0 as this device has entry in /sys/class/watchdog.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-17 15:47:39 +02:00
Karel Zak 5d628f37b7 wdctl: remove printing from main()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-17 15:47:39 +02:00
Karel Zak a599d1375e wdctl: add control struct
* remove global variables
* keep all together

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-17 15:47:39 +02:00
Karel Zak e4d511d40c wdctl: rename watch dog info struct
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-17 15:47:39 +02:00
Karel Zak 52aa1a6611 include/closestream: avoid close more than once
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-17 15:46:10 +02:00
Karel Zak 25b7045e5d misc: replaces atexit(close_stdout) with new close_stdout_atexit()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-17 15:46:10 +02:00
Karel Zak 73ec5e164c libfdisk: fix fdisk_script_get_table()
Make sure we never return NULL and we reuse the table in code.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-17 15:46:10 +02:00
Karel Zak 9335bfc845 libfdisk: (docs) add notes about fdisk_enable_wipe()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-17 15:46:10 +02:00
Karel Zak bfdca6d728 libfdisk: add fdisk_script_set_table()
This small change improves possibility to modify by script described
PT and use script API in another tools as primary way to create
partitions.

All you need is to compose script by fdisk_script_set_header() and
fdisk_script_set_table() and than apply by fdisk_apply_script().

Requested-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-17 15:46:10 +02:00
Karel Zak cf3b6b71eb lscpu: add a new columns to --cache
References: https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-devices-system-cpu
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-17 15:46:10 +02:00
Karel Zak 0c93519e78 docs: we have 2019 already
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-17 12:55:25 +02:00
Karel Zak d4319b91c9 build-sys: release++ (v2.34)
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-14 12:34:10 +02:00
Karel Zak 8c00a9107f docs: update v2.34-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-14 12:32:22 +02:00
Karel Zak 213b3b98e2 docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-14 12:30:20 +02:00
Karel Zak 43731e751f po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-14 12:18:19 +02:00
Boyuan Yang 0de2e6a7de po: update zh_CN.po (from translationproject.org) 2019-06-14 12:13:54 +02:00
Yuri Chornoivan e3478efa74 po: update uk.po (from translationproject.org) 2019-06-14 12:13:54 +02:00
Sebastian Rasmussen 2d5f607575 po: update sv.po (from translationproject.org) 2019-06-14 12:13:53 +02:00
Rafael Fontenelle daa531bc15 po: update pt_BR.po (from translationproject.org) 2019-06-14 12:13:53 +02:00
Jakub Bogusz 398e838ef3 po: update pl.po (from translationproject.org) 2019-06-14 12:13:53 +02:00
Takeshi Hamasaki e77ab61851 po: update ja.po (from translationproject.org) 2019-06-14 12:13:53 +02:00
Božidar Putanec 39fc89ad10 po: update hr.po (from translationproject.org) 2019-06-14 12:13:53 +02:00
Frédéric Marchal ee80e8ae21 po: update fr.po (from translationproject.org) 2019-06-14 12:13:53 +02:00
Antonio Ceballos Roa 087c91f509 po: update es.po (from translationproject.org) 2019-06-14 12:13:53 +02:00
Mario Blättermann 0024767e4b po: update de.po (from translationproject.org) 2019-06-14 12:13:53 +02:00
Joe Hansen 5e8ec215bb po: update da.po (from translationproject.org) 2019-06-14 12:13:53 +02:00
Petr Písař b4d0a5f0ab po: update cs.po (from translationproject.org) 2019-06-14 12:13:53 +02:00
Karel Zak d06ffd28d4 tests: update build-sys output
It seems, no more libgcc_s...

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-14 12:06:58 +02:00
Karel Zak ed16c910be libsmartcols: fix docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-13 13:45:46 +02:00
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