Commit Graph

13875 Commits

Author SHA1 Message Date
Matthew Harm Bekkema 033e473508 unshare: fix --map-current-user short option (-c)
'c' was missing from the optstring, causing the error:

    $ unshare --user -c
    unshare: invalid option -- 'c'
    Try 'unshare --help' for more information.

Fixes: 4175f29e62 ("unshare: add --map-current-user option")
Signed-off-by: Matthew Harm Bekkema <id@mbekkema.name>
2020-01-02 00:19:45 +11:00
Karel Zak 6d67d84319 build-sys: release++ (v2.35-rc1)
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-11 10:55:14 +01:00
Karel Zak 8b8985dd1b docs: add v2.35-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-11 10:52:51 +01:00
Karel Zak 10dcb8d133 Merge branch 'dmverity_options' of https://github.com/bluca/util-linux
* 'dmverity_options' of https://github.com/bluca/util-linux:
  verity: add support for Forward Error Correction options
  verity: ensure that hash_device and root_hash[_file] are passed together or not at all
  verity: add new verity.roothashfile option
2019-12-10 14:46:13 +01:00
Karel Zak 225c4ff92a docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-10 14:08:26 +01:00
Karel Zak d462a45d76 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-10 14:04:50 +01:00
Pedro Albuquerque 7e148b5a31 po: add pt.po (from translationproject.org) 2019-12-10 13:57:19 +01:00
Boyuan Yang cc7948a9e3 po: update zh_CN.po (from translationproject.org) 2019-12-10 13:57:19 +01:00
Takeshi Hamasaki 444e4a0f7c po: update ja.po (from translationproject.org) 2019-12-10 13:57:19 +01:00
Mario Blättermann 5f852d7b61 po: update de.po (from translationproject.org) 2019-12-10 13:57:19 +01:00
Luca Boccassi 9835a4b6a1 verity: add support for Forward Error Correction options
Requires kernel built with CONFIG_DM_VERITY_FEC.
2019-12-10 12:52:39 +00:00
Luca Boccassi fe8358bf05 verity: ensure that hash_device and root_hash[_file] are passed together or not at all
If a hash device or a roothash are passed for verity usage, both have to be present
or we cannot use them. Make it an error to pass only one of them.
2019-12-10 12:52:39 +00:00
Luca Boccassi 141bb954e7 verity: add new verity.roothashfile option
Allow users to point mount to a file to read the roothash, in addition
to passing it inline.
Allows a volume managed by a systemd mount unit to be updated without
changing the mount unit content itself, for easier and more user friendly
servicing.
2019-12-10 12:52:39 +00:00
Karel Zak 4af92de983 build-sys: remove duplicate includes
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-10 13:50:18 +01:00
Karel Zak ac17a625ce build-sys: add missing header
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-10 12:31:59 +01:00
Karel Zak bba1a60198 kill: add another ifdef
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-10 11:07:30 +01:00
Karel Zak 8aab38783a kill: add missing ifdefs
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-09 16:20:06 +01:00
Karel Zak 8e0b90e012 script: document SIGUSR1
Based on pull request: https://github.com/karelzak/util-linux/pull/815

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-09 16:10:02 +01:00
Karel Zak 7727be1af1 script: listen to SIGUSR1, flush logs on the signal
Based on pull request: https://github.com/karelzak/util-linux/pull/815

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-09 16:04:18 +01:00
Karel Zak ded3735ef4 kill: deallocate follow_ups [assan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-09 13:20:04 +01:00
Karel Zak 1395236acd kill: make man page more informative about --timeout
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-09 13:11:16 +01:00
Karel Zak 26c2ad6c38 kill: report features on -V, add lish_header initialization
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-09 12:40:53 +01:00
Karel Zak b6c3de881c include/pidfd-utils: small cleanup
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-09 12:22:31 +01:00
Karel Zak e601521259 Merge branch 'kill-pidfd' of https://github.com/kerolasa/util-linux
* 'kill-pidfd' of https://github.com/kerolasa/util-linux:
  kill: use pidfd system calls to implement --timeout option
  build-sys: add missing NR underscore to UL_CHECK_SYSCALL()
2019-12-09 12:20:22 +01:00
Karel Zak 885fe4e57b Merge branch 'make-manpage-of-su-clearer' of https://github.com/your-diary/util-linux
* 'make-manpage-of-su-clearer' of https://github.com/your-diary/util-linux:
  Slight change in terms
  Make the manpage of su clearer
2019-12-09 12:18:38 +01:00
Karel Zak dde4b59369 lib/randutils: re-licensing back to BSD
The file is originally from libuuid, this library is under BSD
licence. Unfortunately, I have added LGPL header by accident to the
file (commit 0f23ee0c85).

The file under LGPL was modified (in relevant way) by Sami,
Christopher and me. We all agree with re-licensing back to BSD.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Christopher James Halse Rogers <chris@cooperteam.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-09 11:30:55 +01:00
Manatsu Takahashi ebaf1d55b4 Slight change in terms 2019-12-08 22:26:26 +09:00
Manatsu Takahashi 1ffc4f7dcb Make the manpage of su clearer 2019-12-08 22:20:53 +09:00
Pierre Labastie 90084a2608 docs: Fix adjtime documentation
The first line of the adjtime file is made of three numbers (see=20
hwclock.c):
	- a drift factor as a decimal float
	- the time of last adjust as a decimal integer
	- a zero (for compatibility) as a decimal float.

but both man pages (hwclock.8 and adj_time.5) tell that the third
number is a decimal integer.

Of course this is harmless if somebody edits the adjtime file with
"0"=20 as the third number: it will be correctly read by hwclock
anyway.  But if for some reason, a program reads the adjtime file and
expects an integer, it will fail, because hwclock writes O.OOOO0O as
the third=20 number.

Signed-off-by:: Pierre Labastie <pierre.labastie@neuf.fr>
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-06 12:50:46 +01:00
Jouke Witteveen 1c788737d7 su: silence a useless warning
When the requested shell matches the restricted shell, there is no reason
to issue a warning, since we will be doing precisely as requested.

Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com>
2019-12-06 12:40:55 +01:00
Karel Zak 62dc77f3a2 mount: add verity example to man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-05 15:32:23 +01:00
Karel Zak fadb5ebf9c build-sys: add --with-cryptsetup to config-gen.d/all.conf
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-05 14:57:50 +01:00
Karel Zak cbc390da3a libmount: add verity to mount -V output
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-05 14:57:29 +01:00
Karel Zak c9300c7d6e mount: (dm-verity) update man page
* move to separate section (like we use for LOOP DEVICE support)
* explain what dm-verity + mount(8) does

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-05 13:47:53 +01:00
Karel Zak 9309ca1b93 Merge branch 'dmverity' of https://github.com/bluca/util-linux
* 'dmverity' of https://github.com/bluca/util-linux:
  libmount: add support for verity devices via libcryptsetup
2019-12-05 13:23:46 +01:00
Luca Boccassi e6a498877c libmount: add support for verity devices via libcryptsetup
The following new options are added:

verity.hashdevice
verity.roothash
verity.hashoffset

The source path will be used as a dm-verity object, and will be
opened using libcryptsetup APIs.

A new --with-cryptsetup build-time option is added, which adds a
dependency on libcryptsetup. To ease bootstrapping, given libcryptsetup
build-depends on util-linux for libuuid, if --with-cryptsetup=yes but
libcryptsetup is not installed only a warning will be printed at
configure time rather than an error. This way stage0/first stage/ring0
builds can use the same configure options but avoid installing
cryptsetup to get a working base set, and then rebuild util-linux in
the next step of the boostrapping process.

If verity options are selected but cannot be fullfilled due to lack of
dependencies, mounting a volume will fail even if using a loop device
would work as a fallback, to avoid silently skipping integrity checks.
2019-12-05 10:39:21 +00:00
Karel Zak 107e955946 lsblk: add PARTTYPENAME column
Print also partition type in human-readable way.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1777261
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-04 12:38:57 +01:00
Karel Zak 96c2b09fcb libfdisk: move GPT partition types to include/
We need the array use in another tools too. Let's follow the way we
use for MBR and keep it in include/.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-04 12:37:22 +01:00
Karel Zak 3861c371f6 Merge branch 'mount-eperm'
* mount-eperm:
  mount: no exit on EPERM, continue without suid
2019-12-03 15:23:53 +01:00
Karel Zak ac0391cc4f unshare: cleanup capabilities code [lgtm scan]
- remove C++isms
- remove unnecessary { }
- remove if-if
- remove unnecessary condition

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-03 15:15:22 +01:00
Karel Zak b4251e5151 libfdisk: improve Sun partitions calculation [lgtm scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-03 15:07:58 +01:00
Karel Zak 5fbb920ed4 libblkid: improve MD I/O size calculation [lgtm scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-03 14:51:31 +01:00
Karel Zak 2d1e803b08 libblkid: improve vfat entries calculation [lgtm scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-03 14:49:16 +01:00
Karel Zak 48f80ab3b0 lscpu: make code more readable [lgtm scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-03 14:35:43 +01:00
Karel Zak 6f7c67a5ff libmount: fix typo in mnt_context_prepare_helper() [lgtm scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-03 14:31:55 +01:00
Karel Zak 21c97651f4 tests: mark scriptlive as KNOWN_FAILED
Not sure why, but on travis-ci the shell output is little bit
different, probably depends on shell version, etc.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-26 09:56:24 +01:00
Sami Kerola 6e6b9a1d24
kill: use pidfd system calls to implement --timeout option
At times there is need in scripts to send multiple signals to a process.
Often these cases require some amount of waiting before follow-up signal
should be sent.

One common case is process termination, where first script tries to kill
process gracefully but if that does not work SIGKILL is sent.  Functionality
like that is commonly done by periodically checking if signalled pid exist
or not, and if it does another signal is sent possibly to an unrelated
process that reused pid number.  That means polling a pid is prone to a data
race.  Also if the first signal immediately kills the process one polling
interval is lost in sleep.

Another example when multiple signal need to be sent is various daemon
process control situations, such as Upgrading Executable on the Fly (see
reference).  This happens to be the case that inspired change author to make
sequential signaling a little bit easier.

Reference: http://nginx.org/en/docs/control.html#upgrade
Pull-request: https://github.com/karelzak/util-linux/pull/902
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-11-25 21:25:50 +00:00
Sami Kerola ca27517aae
build-sys: add missing NR underscore to UL_CHECK_SYSCALL()
The unistd.h defines system call numbers with two leading underscores.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-11-25 20:33:05 +00:00
Karel Zak 52722cda11 tests: another prompt fix
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-25 14:09:38 +01:00
Karel Zak 897166a86d build-sys: fix out-of-tree build for hwclock
The file sys-utils/hwclock-parse-date.c is generated from .y and
stored in the build directory and "#include hwclock.h" is interpreted
relatively to the build tree rather than to source tree. We need
explicit -I compiler option to point to $srcdir for hwclock.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-25 13:55:18 +01:00