Commit Graph

12150 Commits

Author SHA1 Message Date
Karel Zak
61b9233995 lib/mangle: return size of the decoded buffer
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-11-01 15:33:04 +01:00
Karel Zak
da96496322 dmesg: add note about -F format to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-30 15:45:02 +01:00
Karel Zak
8a6f0cfd96 Revert "dmesg: fragment concatenation"
* introduces regressions
* stupid code; parse_kmsg_record() called more than once for each record

This reverts commit 22eb2f0190.
2017-10-30 15:04:20 +01:00
Nik Nyby
a7da792223 Fix typo in carefulputc.h
Signed-off-by: Nik Nyby <nikolas@gnu.org>
2017-10-25 00:19:19 -04:00
Milan Broz
9ffd0bd661 tests: add LUKS test images
Testing image contains only the first 4k sector, so it is not valid,
but for blkid it should be enough.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
2017-10-24 12:44:53 +02:00
Milan Broz
573538bfba blkid: Add support for LUKS2 and new LABEL attributes.
This patch adds support for detection of a LUKS2 superblock.

LUKS2 is new version of Linux Unified Key Setup for encrypted
block devices.

LUKS2 contains a binary header and then JSON area for metadata.
Blkid should only parse the binary part, including newly available
optional LABEL and SUBSYSTEM fields.

LABEL is similar to filesystem label. The SUBSYSTEM field is
in principle, just a second label and can be used for specific udev rules
(for example if you have some 3rd party system that activates
volumes automatically, you can mark devices using this attribute).
Both labels are optional.

The magic string and UUID location are intentionally on the same offset
as LUKS v1, so even unpatched blkid now recognizes LUKS2.

Anyway, the code should not parse other versions of the header, so we now
explicitly check for header version and support only version 1 and 2.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
2017-10-23 16:31:46 +02:00
Karel Zak
c71665adb5 chmem: cleanup includes
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-23 15:49:22 +02:00
Karel Zak
d182565be1 lib/path: make path_set_prefix() independent on cpu_set_t
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-23 15:45:01 +02:00
Karel Zak
7b41ad363f lib/signames: fix redefinition of 'sys_signame' on OSX
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-23 15:17:10 +02:00
Karel Zak
525a0ab2f5 unshare: cleanup if-if code
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-23 13:19:59 +02:00
Karel Zak
c61e986fd0 lib/signames: remove signame array from header file
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-23 13:18:57 +02:00
Karel Zak
c5910c7f27 Merge branch 'kill-child-feature' of https://github.com/nh2/util-linux
* 'kill-child-feature' of https://github.com/nh2/util-linux:
  unshare: Allow passing <signame> to --kill-child
  unshare: Add --kill-child option.
  signames: Make input char buffers const
  kill: Extract signal names into signames.h/signames.c
2017-10-23 12:58:21 +02:00
Karel Zak
b41bac08ab build-sys: move rfkill to /usr/sbin
The original implementation uses sbin, let's do it too.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-20 14:59:16 +02:00
Karel Zak
c774252a46 tests: update lsmem
* add --split

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-20 14:33:47 +02:00
Karel Zak
d12e945dbf lsmem: add --split
Now the way how lsmem lists memory ranges is affected by used output
columns.  It makes it very difficult to use in scripts where you want
to use for example only one column

	ranges=$(lsmem -oRANGE)

and in this case all is merged to the one (or two) huge ranges and all
attributes are ignored. The --split allows to control this behavior

	ranges=$(lsmem -oRANGE --split=STATE,ZONES)

forces lsmem to list ranges by STATE and ZONES differences.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-20 12:37:04 +02:00
Karel Zak
87a24d85f5 lsmem: add hint about block merges to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-20 12:37:04 +02:00
Karel Zak
9c41d2701f lsmem: improve path_read_xxx() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-20 12:37:04 +02:00
Karel Zak
96b6448d5d chmem: cleanup usage()
Just to be compatible with another u-l tools.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-20 12:37:04 +02:00
Andre Wild
afee3f2042 lsmem/chmem: add memory zone awareness to bash-completion
This patch extends the valid --output values with ZONES for the
lsmem bash-completion, and adds the --zone option for the chmem
bash-completion.

Signed-off-by: Andre Wild <wild@linux.vnet.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
2017-10-20 12:37:04 +02:00
Gerald Schaefer
0a4320f5e7 tests/lsmem: update lsmem test with ZONES column
The existing s390 and x86_64 dumps already contain the valid_zones sysfs
attribute, so just add a new "lsmem -o +ZONES" test command and update
the expected results.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
2017-10-20 12:37:04 +02:00
Gerald Schaefer
60a7e9e94e lsmem/chmem: add memory zone awareness
With this patch, valid memory zones can be shown with lsmem, and chmem can
set memory online/offline in a specific memory zone, if allowed by the
kernel. The valid memory zones are read from the "valid_zones" sysfs
attribute, and setting memory online to a specific zone is done by
echoing "online_kernel" or "online_movable" to the "state" sysfs
attribute, in addition to the previous "online".

This patch also changes the default behavior of chmem, when setting memory
online without specifying a memory zone. If valid, memory will be set
online to the zone Movable. This zone is preferable for memory hotplug, as
it makes memory offline much more likely to succeed.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
2017-10-20 12:37:04 +02:00
Karel Zak
c08396c769 libmount: use eacess() rather than open() to check mtab/utab
The open() syscall is probably the most strong way how to check write
accessibility in all situations, but it's overkill and on some
paranoid systems with enabled audit/selinux. It fills logs with
"Permission denied" entries. Let's use eaccess() if available.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-20 12:37:04 +02:00
Karel Zak
27e66e59a3 build-sys: release++ (v2.31)
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-19 13:08:49 +02:00
Karel Zak
568624d577 docs: update v2.31-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-19 13:06:00 +02:00
Karel Zak
9155d035e4 docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-19 13:00:06 +02:00
Karel Zak
08b1bd5103 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-19 12:57:57 +02:00
Sebastian Rasmussen
20fc15cfec po: update sv.po (from translationproject.org) 2017-10-19 12:53:09 +02:00
Rafael Fontenelle
ddc20b9ebd po: update pt_BR.po (from translationproject.org) 2017-10-19 12:53:09 +02:00
Jakub Bogusz
cf68f67792 po: update pl.po (from translationproject.org) 2017-10-19 12:53:09 +02:00
Sami Kerola
9e33cddd94 rfkill: fix description name typo
Commit 7d2a9960ad made gps to look like a GUID Partition Table.

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-10-17 10:15:21 +02:00
Karel Zak
beaca64a6c blkid: improve man page wording
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-16 23:26:45 +02:00
Karel Zak
27fbfef33c blkid: more info about ambivalent results to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-16 12:01:41 +02:00
Karel Zak
12786a9015 blkid: cleanup man page info about lsblk
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-16 11:45:41 +02:00
James Sanford
e1b1c7b082 zramctl: fix show all non-zero zram devices
Addresses: https://github.com/karelzak/util-linux/issues/521
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-16 11:04:03 +02:00
James Sanford
4847bb5ee9 zramctl: remove unused ZRAM_EMPTY and blank line 2017-10-14 00:57:05 -07:00
Niklas Hambüchen
8b39a17c3b unshare: Allow passing <signame> to --kill-child 2017-10-14 04:46:13 +02:00
Niklas Hambüchen
8e8f0fa59a unshare: Add --kill-child option.
This allows to conveniently kill the entire process tree
below the forked program, a common problem when scripting
tasks that need to reliably fully terminate without leaving
reparented subprocesses behind.

The example added to the man page shows the most common use.

Implemented using prctl(PR_SET_PDEATHSIG, ...).
2017-10-14 04:46:13 +02:00
Niklas Hambüchen
b6e1977db4 signames: Make input char buffers const 2017-10-14 04:46:13 +02:00
Niklas Hambüchen
6855f6e80b kill: Extract signal names into signames.h/signames.c 2017-10-14 04:46:13 +02:00
Karel Zak
dec4fae21b rfkill: fix typo [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-12 14:53:32 +02:00
Karel Zak
e9aa2a14b0 losetup: fix bitwise vs. logical typo [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-12 14:45:11 +02:00
Karel Zak
9d4f78ef0e ipcs: fix memory leak [coverity scan]
It's not important, but let's keep static analyzes happy.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-12 14:39:54 +02:00
Karel Zak
2d4c226dfb logger: keep header generators independent on connection
* avoid memory leaks
* don't use incomplete or header after free()

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-12 14:21:27 +02:00
Karel Zak
5794087292 fincore: make sure mmap(NULL, ...) [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-12 12:44:55 +02:00
Karel Zak
f086478af4 libsmartcols: (sample) cleanup line separator usage
* add comment to explain when nolinesep flag is necessary
* force to print \n before switch to the next line to support

	  ./sample-scols-continuous > file

use case.

Addresses: https://github.com/ignatenkobrain/python-smartcols/issues/18
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-12 12:03:57 +02:00
Karel Zak
1e46776263 libsmartcols: (docs) add note about line separators
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-12 11:33:49 +02:00
Karel Zak
be64282665 lslogins: fix possible memory leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-11 15:13:44 +02:00
Karel Zak
a30f2a9b7a libsmartcols: don't call free_buffer() for uninitialized variable [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-11 15:06:41 +02:00
Karel Zak
78c57214ad libmount: make sure we call stat() propely [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-11 14:59:16 +02:00
Karel Zak
ee7f1e9e08 libfdisk: (sun) make math more robust [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-11 14:50:43 +02:00