systemd/.git
5 years agokernel-install/90-loaderentry: fix when /boot is not mountpoint v245.8
Kir Kolyshkin [Sat, 1 Aug 2020 02:24:15 +0000 (19:24 -0700)]
kernel-install/90-loaderentry: fix when /boot is not mountpoint

I happen to have a machine where /boot is not a separate mountpoint,
but rather just a directory under /. After upgrade to recent Fedora,
I found out that grub2 can't find any new kernels.

This happens because loadentry script generates kernel and initrd file
paths relative to /boot, while grub2 expects path to be relative to the
root of filesystem on which they are residing.

This commit fixes this issue by using stat's %m to find the mount point
of a partition holding the images, and using it as a prefix to be
removed from ENTRY_DIR_ABS.

Note that %m for stat requires coreutils 8.6, released in Oct 2010.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 1cdbff1c844ce46f1d84d8feeed426ebfd550988)
(cherry picked from commit 2ee1c57c4ff4fd3349cf03c2e89fbd18ca0b3a4a)

5 years agohomed: make clean that --storage=directory --image-path=/dev/some-block-device is...
Lennart Poettering [Fri, 18 Sep 2020 17:37:05 +0000 (19:37 +0200)]
homed: make clean that --storage=directory --image-path=/dev/some-block-device is not supported

The directory backend needs a file system path, and not a raw block
device. That's only supported for the LUKS2 backend.

Let's make this clearer in the man page and also generate a better error
message if attempted anyway.

Fixes: #17068
(cherry picked from commit f9d525ae558105bf7fd77ad76e4fdb135bb9f634)
(cherry picked from commit a2a8802abe1289e200213130764c81da2c4fbf4e)

5 years agohomed: make sure our worker processes finish before we exit
Lennart Poettering [Fri, 18 Sep 2020 16:53:12 +0000 (18:53 +0200)]
homed: make sure our worker processes finish before we exit

When exiting, let's explicitly wait for our worker processes to finish
first. That's useful if unmounting of /home/ is scheduled to happen
right after homed is down, as we then can be sure that the home
directories are properly unmounted and detached by the time homed is
fully terminated (otherwise it might happen that our worker gets killed
by the service manager, thus leaving the home directory and its backing
devices up/left for auto-clean which might be async).

Likely fixes #16842

(cherry picked from commit 9796a9fbad5bae4d66bb40d848f6245d1ee327d8)
(cherry picked from commit e1df274a76832d3b25a284a92790c5b85a1a88a7)

5 years agonspawn: fix fd leak on failure path
Lennart Poettering [Wed, 16 Sep 2020 20:16:10 +0000 (22:16 +0200)]
nspawn: fix fd leak on failure path

(cherry picked from commit 2fef50cd9eee59cea6145639f6bd464939fac624)
(cherry picked from commit f2763ff6cd9385e82171e17ed83a7698c7f561fd)

5 years agonspawn: check return of setsid()
Lennart Poettering [Wed, 16 Sep 2020 20:11:48 +0000 (22:11 +0200)]
nspawn: check return of setsid()

Let's verify that everything works the way we expect it to work, hence
check setsid() return code.

(cherry picked from commit efe426624046089b74b70708e61f304f3cd414a7)
(cherry picked from commit 6f9c8af500fd4362d656917703eab4f941e7e45a)

5 years agodissect: is_loop_device() returns negative on error, don't mistake that is true
Lennart Poettering [Thu, 17 Sep 2020 15:24:33 +0000 (17:24 +0200)]
dissect: is_loop_device() returns negative on error, don't mistake that is true

(cherry picked from commit 3afda7c7976c25db786948a961873fa5c2c8e0e9)
(cherry picked from commit 31875b3cb05a2de76054752d40a810e40c8dbe87)

5 years agodissect: always invalidate secondary arch partitions if we found primary arch
Lennart Poettering [Thu, 17 Sep 2020 15:32:34 +0000 (17:32 +0200)]
dissect: always invalidate secondary arch partitions if we found primary arch

Let's suppress the secondary arch data, since we never ever want to
mount it if we found the primary arch.

Previously we only suppressed in the Verity case, but there's little
reason to entertain the idea of a secondary arch in non-Verity
environments either, we are not going to use them, and should not do
decryption or anything like that.

(cherry picked from commit 74cb2db9f403dfe17cabc6dac48b0f49a84eb03f)
(cherry picked from commit 418cf0e78c067f7249f4769f78c8c199d907935f)

5 years agoutil: wireguard is merged into upstream kernel
Yu Watanabe [Thu, 17 Sep 2020 05:49:47 +0000 (14:49 +0900)]
util: wireguard is merged into upstream kernel

(cherry picked from commit e29e5db7dff1442ef73cbcd0c898e11078e1042d)
(cherry picked from commit 1d17c00260a923188363fc32363ff8b6bae06230)

5 years agoman: substitute path to rc.local in the man page
Zbigniew Jędrzejewski-Szmek [Tue, 15 Sep 2020 15:56:32 +0000 (17:56 +0200)]
man: substitute path to rc.local in the man page

Different systems use different paths for it and users are confused when the
man page has a path different than the one on the local system.

https://bugzilla.redhat.com/show_bug.cgi?id=1876905
(cherry picked from commit c2ee27a5e7fa1c6a71341579baa2d941c6e3e6e6)
(cherry picked from commit 9353607ef3cff4902296268bab0ccc82dc8b04c2)

5 years agomeson: RC_LOCAL_SCRIPT_PATH_START to RC_LOCAL_PATH
Zbigniew Jędrzejewski-Szmek [Tue, 15 Sep 2020 15:44:26 +0000 (17:44 +0200)]
meson: RC_LOCAL_SCRIPT_PATH_START to RC_LOCAL_PATH

RC_LOCAL_SCRIPT_PATH_START and RC_LOCAL_SCRIPT_PATH_STOP were was originally
added in the conversion to meson based on the autotools name. In
44508946534eee032927c263b79464832656dd6e RC_LOCAL_SCRIPT_PATH_STOP was dropped.
We don't need to use such a long name.

(cherry picked from commit 452d2dfd52f1cc686395663a6cd4c778306bd309)
(cherry picked from commit f2b9345cd2d717fb227e4c6775134e83d09e4790)

5 years agosocket-proxy: allow localhost addresses
Zbigniew Jędrzejewski-Szmek [Tue, 15 Sep 2020 12:52:47 +0000 (14:52 +0200)]
socket-proxy: allow localhost addresses

With this change, only manager_connect() in timesync.d uses AI_ADDRCONFIG. There
we are connecting to a remove server, so the flag is appropriate.

(cherry picked from commit 7e5f1d4b3fb02075762a55063edf9e510142e4c9)
(cherry picked from commit b0fff9012a0d58624ae656b766be93655ff83f8d)

5 years agosd-bus: allow localhost addresses
Zbigniew Jędrzejewski-Szmek [Tue, 15 Sep 2020 12:49:36 +0000 (14:49 +0200)]
sd-bus: allow localhost addresses

By settings AI_ADDRCONFIG in hints we cannot for example resolve "localhost"
when the local machine only has a loopback interface. This seems like an
unnecessary restriction, drop it.

Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=1839007.

(cherry picked from commit d0e5db44d9e1cf61ca75c8a86ffed19cc1b7fe5f)
(cherry picked from commit 5e8bf33de11c36e78f66cd5648a7643a417c561c)

5 years agofstab-generator: add 'nofail' when NFS 'bg' option is used
Franck Bui [Tue, 15 Sep 2020 09:49:09 +0000 (11:49 +0200)]
fstab-generator: add 'nofail' when  NFS 'bg' option is used

Otherwise a 'Before=remote-fs.target' dependency is added to the mount unit
which defeats the purpose of 'bg' option.

(cherry picked from commit e66d2eeeeb4332ca94aeb62e95ec76f1f17ee9b7)
(cherry picked from commit ad77a988f2ef7f8adb2b4d54b9fc37a48f6a52df)

5 years agobusctl: add missing shortopt -l
Juergen Hoetzel [Tue, 15 Sep 2020 06:09:51 +0000 (08:09 +0200)]
busctl: add missing shortopt -l

(cherry picked from commit 150c430fd499082164b6ddbd2f501e2333261a78)
(cherry picked from commit d08f6fddc0a04a212dff9da14f77e3923414c233)

5 years agosocket-util: reset length argument for second getsockopt call in fd_[gs]et_rcvbuf
Christian Göttsche [Mon, 14 Sep 2020 17:40:42 +0000 (19:40 +0200)]
socket-util: reset length argument for second getsockopt call in fd_[gs]et_rcvbuf

In case the first getsockopt() call changes the value.

(cherry picked from commit 67f5ae2d6986d0271fa6223a68fe0104957de863)
(cherry picked from commit 64d58480ac2e5da611d181beab22ee4b4299f522)

5 years agotest: use pclose() for popen()
Zbigniew Jędrzejewski-Szmek [Mon, 14 Sep 2020 20:32:52 +0000 (22:32 +0200)]
test: use pclose() for popen()

Coverity CID#1432701.

(cherry picked from commit 649bde89caccdb1187ac744bd76051fdcd687218)
(cherry picked from commit 0046c5833423ef0ff523b01b130b9cbfc54d58ab)

5 years agocore: propagate unit start limit hit state to triggering path unit
Lennart Poettering [Fri, 11 Sep 2020 17:57:09 +0000 (19:57 +0200)]
core: propagate unit start limit hit state to triggering path unit

We already do this for socket and automount units, do it for path units
too: if the triggered service keeps hitting the start limit, then fail
the triggering unit too, so that we don#t busy loop forever.

(Note that this leaves only timer units out in the cold for this kind of
protection, but it shouldn't matter there, as they are naturally
protected against busy loops: they are scheduled by time anyway).

Fixes: #16669
(cherry picked from commit 47ab8f73e3468b6e5a48218eacdb830e978d2cfd)
(cherry picked from commit 689d2e061bd7b04f75104067e5ff0046f357f9b8)

5 years agocore: propagate triggered unit in more load states
Lennart Poettering [Fri, 11 Sep 2020 17:49:33 +0000 (19:49 +0200)]
core: propagate triggered unit in more load states

In 4c2ef3276735ad9f7fccf33f5bdcbe7d8751e7ec we enabled propagating
triggered unit state to the triggering unit for service units in more
load states, so that we don't accidentally stop tracking state
correctly.

Do the same for our other triggering unit states: automounts, paths, and
timers.

Also, make this an assertion rather than a simple test. After all it
should never happen that we get called for half-loaded units or units of
the wrong type. The load routines should already have made this
impossible.

(cherry picked from commit 0377cd2936ae5cac0c9d76a4b58889f121c097c4)
(cherry picked from commit 2f53d690ead37ee48b64ab650697f2f8be7c0ceb)

5 years agobootctl: handle if LoaderSystemToken is invalid for some reason
Lennart Poettering [Mon, 14 Sep 2020 10:35:19 +0000 (12:35 +0200)]
bootctl: handle if LoaderSystemToken is invalid for some reason

This points to some firmware issue, but we should still be able to
correct things if this happens. Hence log about this and fix it.

Fixes: #17041
(cherry picked from commit ad0b610b0c1c2595c32b6235e7ac5ad7fba6e0aa)
(cherry picked from commit a06cf9a5bad917b9ac6016c940c5f0f0238f266f)

5 years agotest-fileio: test test strings with shell, too
Lennart Poettering [Fri, 11 Sep 2020 15:43:05 +0000 (17:43 +0200)]
test-fileio: test test strings with shell, too

(cherry picked from commit df8b14b59119c61f660037710bbb3899db441ef7)
(cherry picked from commit e2c0023dd2c18500ffa9a07522b9a860f358311f)

5 years agotest-env-file: add test that tests our env file read + writer + shell against each...
Lennart Poettering [Fri, 11 Sep 2020 13:18:07 +0000 (15:18 +0200)]
test-env-file: add test that tests our env file read + writer + shell against each other

Should hopefully make regressions on this unlikely.

(cherry picked from commit 55f99c26c678b4bf4fb697a57d540b0266aa3f49)
(cherry picked from commit 251b96c9b5c8424c1a3bc2a91e3aaff03cdb14d8)

5 years agoenv-file: bring our decoding of double-quoted strings in env files in line with shell
Lennart Poettering [Fri, 11 Sep 2020 13:14:03 +0000 (15:14 +0200)]
env-file: bring our decoding of double-quoted strings in env files in line with shell

In shell, inside of double quotes only a select few chars should be
escaped. If other chars are escaped this has no effect. Correct the list
of chars that need such escaping.

Also, make sure we can read back the stuff we wrote out without loss.

Fixes: #16788
(cherry picked from commit de008e537dc6e3504f988fa9bd358f783016df8a)
(cherry picked from commit 4d1922d8bb42540b20ede62958d8b4d426f86b5d)

5 years agotest-fileio: use test strings that are actually valid in shell
Lennart Poettering [Fri, 11 Sep 2020 15:42:46 +0000 (17:42 +0200)]
test-fileio: use test strings that are actually valid in shell

(cherry picked from commit 6fe3196350fdb8715aabd315f8252c307da6661c)
(cherry picked from commit 281581cd7437dac5a3f787b7ea73b0bab53bd1e6)

5 years agoman: document that RemainAfterElapse=no means that also the triggered unit needs...
Lennart Poettering [Thu, 10 Sep 2020 17:08:45 +0000 (19:08 +0200)]
man: document that RemainAfterElapse=no means that also the triggered unit needs to deactivate

Fixes: #16378
(cherry picked from commit 415f8a5bfed4604e4a1bc275682d51af3ad3b611)
(cherry picked from commit 366d38d8ed9e1f8ca06c765d1e569b06dfb4de70)

5 years agohashmap: make sure to initialize shared hash key atomically
Lennart Poettering [Fri, 11 Sep 2020 22:09:07 +0000 (00:09 +0200)]
hashmap: make sure to initialize shared hash key atomically

if we allocate a bunch of hash tables all at the same time, with none
earlier than the other, there's a good chance we'll initialize the
shared hash key multiple times, so that some threads will see a
different shared hash key than others.

Let's fix that, and make sure really everyone sees the same hash key.

Fixes: #17007
(cherry picked from commit ae0b700a856c0ae460d271bb50dccfaae84dbcab)
(cherry picked from commit e662cf6d515daad19e70c3d85e244b213ac48997)

5 years agoman: document the random delay of persistent timers
Nazar Vinnichuk [Fri, 11 Sep 2020 10:38:53 +0000 (13:38 +0300)]
man: document the random delay of persistent timers

The manual states that a persistent timer triggers it's service
immediately on activation to catch up with missed invocations, but since
PR #11608 it is no longer the case if RandomizedDelaySec= is set to a
non-zero value.

(cherry picked from commit 5501da15ba34284e50c10ccd6b3ffa8838bb431b)
(cherry picked from commit fb2afc5f30c76965c3a2b5a0f3cc6170b59a6fa4)

5 years agobacklight: do not claim that ID_BACKLIGHT_CLAMP= property is not set
Yu Watanabe [Fri, 11 Sep 2020 08:44:20 +0000 (17:44 +0900)]
backlight: do not claim that ID_BACKLIGHT_CLAMP= property is not set

(cherry picked from commit 06d98bdc81b233584d4b225892d358f324b7030b)
(cherry picked from commit 8758580ef561d9889990c89283acf82f8a9a66dc)

5 years agofs-util,tmpfiles: fix error handling of fchmod_opath()
Lennart Poettering [Wed, 9 Sep 2020 18:35:33 +0000 (20:35 +0200)]
fs-util,tmpfiles: fix error handling of fchmod_opath()

When 4dfaa528d45 was first commited its callers relied on `errno` instead of the
return value for error reporting. Which worked fine, since internally
under all conditions base were set — even if ugly and not inline with
our coding style. Things then got broken in
f8606626ed3c2582e06543550d58fe9886cdca5f where suddenly additional
syscalls might end up being done in the function, thus corrupting `errno`.

(cherry picked from commit dee00c1939c6194404c15a80650d0c04bb01b0db)
(cherry picked from commit 57fc184a6cf8433b5fb353c699b1d3866c93062a)

5 years agoethtool-util: don't pass error value that isn't used to log_syntax
Lennart Poettering [Wed, 9 Sep 2020 21:41:49 +0000 (23:41 +0200)]
ethtool-util: don't pass error value that isn't used to log_syntax

(cherry picked from commit d8ea7f838b1199d240d522ee3ce05d1c263b7ad4)
(cherry picked from commit 3e2c8066817da42063f19153db4fe7c7fe1f837f)

5 years agocryptsetup: Fix null pointer dereference (#16987)
Mikael Szreder [Wed, 9 Sep 2020 19:26:21 +0000 (21:26 +0200)]
cryptsetup: Fix null pointer dereference (#16987)

cryptsetup: Fix null pointer dereference

Fix null pointer dereference in the pkcs11 related code of systemd-cryptsetup

(cherry picked from commit 664ad0f6f54257643fa069d9e1e9cad0f6fd7cc3)
(cherry picked from commit f3da0180170deac1a95f8c08c007046227cdbfc7)

5 years agocore: fix set keep caps for ambient capabilities
Tobias Kaufmann [Fri, 31 Jul 2020 08:57:39 +0000 (10:57 +0200)]
core: fix set keep caps for ambient capabilities

The securebit keep-caps retains the capabilities in the permitted set
over an UID change (ambient capabilities are cleared though).

Setting the keep-caps securebit after the uid change and before execve
doesn't make sense as it is cleared during execve and there is no
additional user ID change after this point.

Altough the documentation (man 7 capabilities) is ambigious, keep-caps
is reset during execve although keep-caps-locked is set. After execve
only keep-caps-locked is set and keep-caps is cleared.

(cherry picked from commit 198dc1784514b800c3e69153839084a55ebf2e84)
(cherry picked from commit 6f65eaf9c2643e0d9e22357f41f0b3d29e18075a)

5 years agocore: fix comments on ambient capabilities
Tobias Kaufmann [Fri, 31 Jul 2020 08:57:15 +0000 (10:57 +0200)]
core: fix comments on ambient capabilities

The comments on the code for ambient capabilities was wrong/outdated.

(cherry picked from commit 16fcb1918a0e4514b1d0d78259d4ffd646b5da59)
(cherry picked from commit 08338a234e381223416d536867199b2f9a2ed30a)

5 years agonetwork: make log_link_error() or friends return void
Yu Watanabe [Tue, 8 Sep 2020 17:33:03 +0000 (02:33 +0900)]
network: make log_link_error() or friends return void

(cherry picked from commit d157714b6819d9e4faa93ef64a5041d5a8ae4779)
(cherry picked from commit f0e6d9876d7931936eaa832a0fd0b11ee516d750)

5 years agocore: make log_unit_error() or friends return void
Yu Watanabe [Tue, 8 Sep 2020 17:28:36 +0000 (02:28 +0900)]
core: make log_unit_error() or friends return void

(cherry picked from commit 8ed6f81ba3b7be55d20a5d703c9aa7d4018b80ed)
(cherry picked from commit 35766dc61b56378dc556ee7900e043ced98ab50c)

5 years agoudev: do not discard const qualifier
Yu Watanabe [Tue, 8 Sep 2020 17:14:55 +0000 (02:14 +0900)]
udev: do not discard const qualifier

(cherry picked from commit 38104ee2a545a0e06fc261c0161aed322285f363)
(cherry picked from commit 2f6406914b3e30e21ee5318eac640b2a76c75c81)

5 years agosd-device: make log_device_error() or friends return void
Yu Watanabe [Tue, 8 Sep 2020 17:10:27 +0000 (02:10 +0900)]
sd-device: make log_device_error() or friends return void

(cherry picked from commit ab54f12b783eea891d6414fbc14cd6fe7cbe4c80)
(cherry picked from commit 07671aa4cc8f0211e77b8227e89d5b73ad7121c0)

5 years agoudev: explicitly specify return value
Yu Watanabe [Tue, 8 Sep 2020 17:08:24 +0000 (02:08 +0900)]
udev: explicitly specify return value

(cherry picked from commit 09c69ecaeb2c63b2b7e20728c4f4704bbb464a9c)
(cherry picked from commit d4bea73972fb7443b3c02261e2c9c174f0ff92f8)

5 years agoudev: return negative errno for invalid EVDEV_ABS_XXX= property
Yu Watanabe [Tue, 8 Sep 2020 17:07:15 +0000 (02:07 +0900)]
udev: return negative errno for invalid EVDEV_ABS_XXX= property

(cherry picked from commit a718b951ac2c2186db22311b611b7e7ccdc30915)
(cherry picked from commit 7db399be1e621a331f68be055b1a89e10a64b8cb)

5 years agoudev: make log_rule_error() or friends return void
Yu Watanabe [Tue, 8 Sep 2020 16:46:06 +0000 (01:46 +0900)]
udev: make log_rule_error() or friends return void

(cherry picked from commit 3b4e123173ba1e4cb6af504d98e0c018d9ccfc8a)
(cherry picked from commit 8c8d188e853f893c64593111a3949c64cfca8380)

5 years agonetwork: do not start device monitor if /sys is read-only
Yu Watanabe [Tue, 8 Sep 2020 14:26:28 +0000 (23:26 +0900)]
network: do not start device monitor if /sys is read-only

Follow-up for bf331d87171b7750d1c72ab0b140a240c0cf32c3.

(cherry picked from commit d31f33e3c9f6ea3bdc873ee52f4398edbec74527)
(cherry picked from commit 3bf7797f1f5d2c97d3b4c108ca487f8d337e8af2)

5 years agoutil: try to set with SO_{RCV,SND}BUFFORCE when requested size is larger than the...
Yu Watanabe [Tue, 8 Sep 2020 15:11:14 +0000 (00:11 +0900)]
util: try to set with SO_{RCV,SND}BUFFORCE when requested size is larger than the kernel limit

The commit 10ce2e0681ac16e7bb3619b7bb1a72a6f98a2f2c inverts the order of
SO_{RCV,SND}BUFFORCE and SO_{RCV,SND}BUF. However, setting buffer size with
SO_{RCV,SND}BUF does not fail even if the requested size is larger than
the kernel limit. Hence, SO_{RCV,SND}BUFFORCE will not use anymore and
the buffer size is always limited by the kernel limit even if we have
the priviledge to ignore the limit.

This makes the buffer size is checked after configuring it with
SO_{RCV,SND}BUF, and if it is still not sufficient, then try to set it
with FORCE command. With this commit, if we have enough priviledge, the
requested buffer size is correctly set.

Hopefully fixes #14417.

(cherry picked from commit b92f350789e33942be0cf85af22a580c1fd483d6)
(cherry picked from commit 4dcae666889ae9469e4406c0bcaffadbc01c4f66)

5 years agoutil: refuse to set too large value for socket buffer size
Yu Watanabe [Tue, 8 Sep 2020 15:07:50 +0000 (00:07 +0900)]
util: refuse to set too large value for socket buffer size

(cherry picked from commit 1263c85ef32ea35969748cd4304cd1a51d19e8d1)
(cherry picked from commit 4b6b523946e4e7235ec2e200026efed5d6137fa8)

5 years agonetwork: ignore error on increasing netlink receive buffer size
Yu Watanabe [Tue, 8 Sep 2020 17:48:25 +0000 (02:48 +0900)]
network: ignore error on increasing netlink receive buffer size

(cherry picked from commit 8c63924c8d1eeb5a173669b8b06230bfe721f139)
(cherry picked from commit b4be8edb455dbeac98840c79fbb5217bbef067b4)

5 years agotree-wide: if get_block_device() returns zero devno, check for it in all cases
Lennart Poettering [Mon, 7 Sep 2020 17:01:41 +0000 (19:01 +0200)]
tree-wide: if get_block_device() returns zero devno, check for it in all cases

And add a comment for the existing cases where things aren't clear
already.

(cherry picked from commit d161680e7afb7ae01593ffc5deb6c02bbc08ed19)
(cherry picked from commit 5ce47fb4913b64e2d52a00a09b764161e1f6001b)

5 years agobtrfs: if BTRFS_IOC_DEV_INFO returns /dev/root generate a friendly error message
Lennart Poettering [Mon, 7 Sep 2020 16:50:41 +0000 (18:50 +0200)]
btrfs: if BTRFS_IOC_DEV_INFO returns /dev/root generate a friendly error message

On systems that boot without initrd on a btrfs root file systems the
BTRFS_IOC_DEV_INFO ioctl returns /dev/root as backing device. That
sucks, since that is not a real device visible to userspace.

Since this has been that way since forever, and it doesn't look like the
kernel will get fixed soon for this, let's at least generate a useful
error message in this case.

This is not a bug fix, just a tweak to make this more recognizable.

Once the kernel gets fixed to report the correct device nodes in this
case, in a way userspace can make sense of them things will magically
work for systemd, too.

(Note that this doesn't add a log message about this to really all cases
we call get_device() in, but just the main ones that are called in early
boot context, after all all there's no benefit in seeing this message
too many times.)

https://github.com/systemd/systemd/issues/16953
https://bugs.freedesktop.org/show_bug.cgi?id=84689
https://bugzilla.kernel.org/show_bug.cgi?id=89721
(cherry picked from commit 67f0ac8c79bb08451a70ee314daf06ee081ef24d)
(cherry picked from commit 8ea6ec18e785599e357eecebc44a726cccc126e3)

5 years agobasic/log: make log_{info,warning,...} return void
Zbigniew Jędrzejewski-Szmek [Tue, 8 Sep 2020 11:18:25 +0000 (13:18 +0200)]
basic/log: make log_{info,warning,...} return void

log_debug still returns 0. I think it is legitimate to use 'return log_debug()' to
return 0. It is different than the other functions, since we often want to supress
errors logged at debug level. This case is quite common in the codebase and
we could use 'return log_debug_errno()' to make the code more consise.

For all other variants, a separate return line is required.
Previous commit changes all the non-conforming instances, now we can make it mandatory.

(cherry picked from commit 44f0dd628ce4ca9565b0e02b8cb63ed8272529cd)
(cherry picked from commit e1ff4947d25bd3b9cb6a4362566cb65ae257b0aa)

5 years agotree-wide: correct cases where return log_{error,warning} is used without value
Zbigniew Jędrzejewski-Szmek [Tue, 8 Sep 2020 10:51:23 +0000 (12:51 +0200)]
tree-wide: correct cases where return log_{error,warning} is used without value

In various cases, we would say 'return log_warning()' or 'return log_error()'. Those
functions return 0 if no error is passed in. For log_warning or log_error this doesn't
make sense, and we generally want to propagate the error. In the few cases where
the error should be ignored, I think it's better to split it in two, and call 'return 0'
on a separate line.

(cherry picked from commit c413bb28df0996be99fd6b3f2335dfe8739d62fb)
(cherry picked from commit 8019995e9af9c6d7b5985198cedccd24eda3e26e)

5 years agotest-execute/exec-dynamicuser-statedir.service: fix quoting
Zbigniew Jędrzejewski-Szmek [Fri, 4 Sep 2020 14:12:40 +0000 (16:12 +0200)]
test-execute/exec-dynamicuser-statedir.service: fix quoting

All backslashes that should be single in shell syntax need to be written as "\\" because
our parser will remove one level of quoting. Also, single quotes were doubly nested, which
cannot work.

Should fix the following message:
test-execute/exec-dynamicuser-statedir.service:16: Ignoring unknown escape sequences: "test $$(find / \( -path /var/tmp -o -path /tmp -o -path /proc -o -path /dev/mqueue -o -path /dev/shm -o -path /sys/fs/bpf -o -path /dev/.lxc \) -prune -o -type d -writable -print 2>/dev/null | sort -u | tr -d \\n) = /var/lib/private/quux/pief/var/lib/private/waldo"

(cherry picked from commit 0b3861d2247fd96ca1ff018bbf35c8465c43323c)
(cherry picked from commit 932f4c3e8b0a1278226a38434e4817a76c0c44f3)

5 years agoman: fix quickhelp listing in sysusers.d(5)
Zbigniew Jędrzejewski-Szmek [Sat, 5 Sep 2020 20:09:02 +0000 (22:09 +0200)]
man: fix quickhelp listing in sysusers.d(5)

Fixes #16958.

(cherry picked from commit fc706b4816f75c01bd78bd5936e5f8740405093a)
(cherry picked from commit 16b9426f7052df4b4d8f313a5f2e0b485bdd5dba)

5 years agohomed: remember the secret even when the for_state is FIXATING_FOR_ACQUIRE
Gibeom Gwon [Wed, 26 Aug 2020 13:56:01 +0000 (22:56 +0900)]
homed: remember the secret even when the for_state is FIXATING_FOR_ACQUIRE

Remember the secret if the for_state is FIXATING_FOR_ACTIVATION or
FIXATING_FOR_ACQUIRE. This fixes login failures when logging in
to an unfixated user.

(cherry picked from commit 3d3d6e10daee37cd0636e15c2d4f29f14354cd72)
(cherry picked from commit fecb3f00c450c83f2ad27bfdab7fa5f8d49f27e7)

5 years agocoredump: don't convert s → µs twice
Lennart Poettering [Tue, 1 Sep 2020 18:29:28 +0000 (20:29 +0200)]
coredump: don't convert s → µs twice

We already append 000000 early on when parsing the cmdline args, let's
not do that a second time.

Fixes: #16919
(cherry picked from commit 64a5384fd2cde9b66a778c318036e7771f273f17)
(cherry picked from commit 2239965c299e53db961f4294ccd5cbbda4f377df)

5 years agofirstboot: fill empty color if ansi_color unavailable from os-release
afg [Tue, 1 Sep 2020 21:20:25 +0000 (05:20 +0800)]
firstboot: fill empty color if ansi_color unavailable from os-release

(cherry picked from commit ae0d36c161ef0b8bde08d37674eb500061245728)
(cherry picked from commit 61d29b7f8c57898ba1a15a8fab90fde7c95efbc6)

5 years agovarlink: do not parse invalid messages twice
Zbigniew Jędrzejewski-Szmek [Fri, 28 Aug 2020 17:22:20 +0000 (19:22 +0200)]
varlink: do not parse invalid messages twice

Upon reception of a message which fails in json_parse(), we would proceed to
parse it again from a deferred callback and hang. Once we have realized that
the message is invalid, let's move the pointer in the buffer even if the
message is invalid. We don't want to look at this data again.

(before) $ build-rawhide/userdbctl --output=json user test.user
n/a: varlink: setting state idle-client
/run/systemd/userdb/io.systemd.Multiplexer: Sending message: {"method":"io.systemd.UserDatabase.GetUserRecord","parameters":{"userName":"test.user","service":"io.systemd.Multiplexer"}}
/run/systemd/userdb/io.systemd.Multiplexer: varlink: changing state idle-client → awaiting-reply
/run/systemd/userdb/io.systemd.Multiplexer: New incoming message: {...}
/run/systemd/userdb/io.systemd.Multiplexer: varlink: changing state awaiting-reply → pending-disconnect
/run/systemd/userdb/io.systemd.Multiplexer: New incoming message: {...}
/run/systemd/userdb/io.systemd.Multiplexer: varlink: changing state pending-disconnect → disconnected
^C

(after) $ n/a: varlink: setting state idle-client
/run/systemd/userdb/io.systemd.Multiplexer: Sending message: {"method":"io.systemd.UserDatabase.GetUserRecord","parameters":{"userName":"test.user","service":"io.systemd.Multiplexer"}}
/run/systemd/userdb/io.systemd.Multiplexer: varlink: changing state idle-client → awaiting-reply
/run/systemd/userdb/io.systemd.Multiplexer: New incoming message: {...}
/run/systemd/userdb/io.systemd.Multiplexer: Failed to parse JSON: Invalid argument
/run/systemd/userdb/io.systemd.Multiplexer: varlink: changing state awaiting-reply → pending-disconnect
/run/systemd/userdb/io.systemd.Multiplexer: varlink: changing state pending-disconnect → processing-disconnect
Got lookup error: io.systemd.Disconnected
/run/systemd/userdb/io.systemd.Multiplexer: varlink: changing state processing-disconnect → disconnected
Failed to find user test.user: Input/output error

This should fix #16683 and https://bugs.gentoo.org/735072.

(cherry picked from commit 77472d06a4740d820ebccdb04e217d6b7d66dd50)
(cherry picked from commit 9678a3daf60260781ac6d7fa34ece76afef6ff10)

5 years agouserdbctl: add forgotten --output mode in help
Zbigniew Jędrzejewski-Szmek [Fri, 28 Aug 2020 15:25:14 +0000 (17:25 +0200)]
userdbctl: add forgotten --output mode in help

(cherry picked from commit c4651e3156463758ffde9a791197d62f76caf6ec)
(cherry picked from commit 4e516dcbc150280c87c3f39d99fa4779875cf140)

5 years agoshared/{user,group}-record-nss: adjust filtering of "valid" passwords
Zbigniew Jędrzejewski-Szmek [Fri, 28 Aug 2020 14:23:16 +0000 (16:23 +0200)]
shared/{user,group}-record-nss: adjust filtering of "valid" passwords

We would reject various passwords that glibc accepts, for example ""
or any descrypted password. Accounts with empty password are definitely
useful, for example for testing or in scenarios where a password is not
needed. Also, using weak encryption methods is probably not a good idea,
it's not the job of our nss helpers to decide that: they should just
faithfully forward whatever data is there.

Also rename the function to make it more obvious that the returned answer
is not in any way certain.

(cherry picked from commit 8f796e40a561bd9200fde3c8885e6255a2dd4250)
(cherry picked from commit aee20dfbd8e286b1e20290ef070cf1061d79f8c7)

5 years agoresolved: make sure we initialize t->answer_errno before completing the transaction
Lennart Poettering [Fri, 28 Aug 2020 20:44:57 +0000 (22:44 +0200)]
resolved: make sure we initialize t->answer_errno before completing the transaction

We must have the error number around when completing the transaction.
Let's hence make sure we always initialize it *first* (we accidentally
did it once after).

Fixes: #11626
(cherry picked from commit fd8a30170342cfe245ea6acac392c2b224f0ae1b)
(cherry picked from commit 38ae73fafd39915e7b40fe311165fcec79fc0ee8)

5 years agosrc/shared/dissect-image.c: fix build without blkdid (#16901)
Fabrice Fontaine [Sat, 29 Aug 2020 21:17:18 +0000 (23:17 +0200)]
src/shared/dissect-image.c: fix build without blkdid (#16901)

N_DEVICE_NODE_LIST_ATTEMPTS is unconditionally used since version 246 and
https://github.com/systemd/systemd/commit/ac1f3ad05f7476ae58981dcba45dfeb2c0006824

However, this variable is only defined if HAVE_BLKID is set resulting in
the following build failure if cryptsetup is enabled but not libblkid:

../src/shared/dissect-image.c:1336:34: error: 'N_DEVICE_NODE_LIST_ATTEMPTS' undeclared (first use in this function)
 1336 |         for (unsigned i = 0; i < N_DEVICE_NODE_LIST_ATTEMPTS; i++) {
      |

Fixes:
 - http://autobuild.buildroot.org/results/67782c225c08387c1bbcbea9eee3ca12bc6577cd
(cherry picked from commit 28e2641a1aa506c5df93c7a0cb107aed8297b45e)
(cherry picked from commit d6b1e659b366283fe7c7961c3d1e1550c6b1b1eb)

5 years agoanalyze: fix error handling in one case
Lennart Poettering [Thu, 27 Aug 2020 13:46:03 +0000 (15:46 +0200)]
analyze: fix error handling in one case

(cherry picked from commit 0f849d0af983922e1571b958c9ca42f51e799190)
(cherry picked from commit e42f9add21da833ce2d26d4763c022aceec20853)

5 years agounits: add missing usb-gadget.target
Kyle Russell [Fri, 28 Aug 2020 13:36:35 +0000 (09:36 -0400)]
units: add missing usb-gadget.target

(cherry picked from commit dd050420390c6557354b0e3aaecd52abc4bf906c)
(cherry picked from commit 4804ce148812b0f682e2c0fe16b4677ba0fc556d)

5 years agologin/logind: Include sys/stat.h for struct stat usage
Ikey Doherty [Fri, 28 Aug 2020 13:23:44 +0000 (14:23 +0100)]
login/logind: Include sys/stat.h for struct stat usage

We need to include `<sys/stat.h>` for usage of the `struct stat` in
the Manager struct, much as we already include `<stdbool.h>` for C99
booleans.

This helps alleviate another minor build failure on non-glibc systems.

(cherry picked from commit 97207ac85cb8f8cba9459694255ff0396f020279)
(cherry picked from commit 2fb612371dfec40a90be975f9110341cac42300d)

5 years agopartition/makefs: Include missing sys/file.h header
Ikey Doherty [Thu, 27 Aug 2020 16:45:45 +0000 (17:45 +0100)]
partition/makefs: Include missing sys/file.h header

This file must be included on non-glibc systems to ensure
the `LOCK_EX` definition is available.

Signed-off-by: Ikey Doherty <ikey.doherty@lispysnake.com>
(cherry picked from commit 677bb0555a9b3b8accf1ecaa8e86d068eb679dda)
(cherry picked from commit 5e884e7ee0476d46b4da769904a067ddbab2132b)

5 years agoman: clarify that several networkctl commands takes device names
Yu Watanabe [Thu, 27 Aug 2020 07:35:25 +0000 (16:35 +0900)]
man: clarify that several networkctl commands takes device names

(cherry picked from commit f2c676c6c016e24f246a21d70e359b9358a2f61d)
(cherry picked from commit dcbea51c5a2bd28a0ea77dbf027358e8e269f473)

5 years agonetworkctl: label command does not take any argument
Yu Watanabe [Thu, 27 Aug 2020 07:32:13 +0000 (16:32 +0900)]
networkctl: label command does not take any argument

(cherry picked from commit df696b1413abfc66e780f96e40f8ad2213af9341)
(cherry picked from commit 16e4cfcc82a872c6d62e638972a9515ea13bcfb0)

5 years agomissing: Add new Linux capability
Michal Koutný [Wed, 26 Aug 2020 13:37:21 +0000 (15:37 +0200)]
missing: Add new Linux capability

Yet another new capability coming in Linux kernel v5.9.
Make sure we can recongize them even when built with older kernel headers.

(cherry picked from commit 94d21c2ef6cd6bb035d4c21c98ab001c0abd4cbe)
(cherry picked from commit 23529212447e6a836440e0729c3562d8e0d4c891)

5 years agotty-ask-pw-agent: properly propagate error
Lennart Poettering [Wed, 26 Aug 2020 21:10:50 +0000 (23:10 +0200)]
tty-ask-pw-agent: properly propagate error

(cherry picked from commit a4fd6cd3f575eb7e1452a74c2e35548739e3b252)
(cherry picked from commit 8b29c4a4f9dff904985293193c5a5b8f9f369afd)

5 years agotty-ask-pw-agent: the message string might not be set
Lennart Poettering [Wed, 26 Aug 2020 21:05:46 +0000 (23:05 +0200)]
tty-ask-pw-agent: the message string might not be set

(cherry picked from commit 66bff73b4f91f8d2fdd385f9f1e2b6339055c9e4)
(cherry picked from commit f7ce2e9839f2a7b3aa97b1f35e5b3f1f66459e93)

5 years agotty-ask-pw-agent: make sure "--list" works correctly
Lennart Poettering [Wed, 26 Aug 2020 21:02:13 +0000 (23:02 +0200)]
tty-ask-pw-agent: make sure "--list" works correctly

Fixes: #16836
(cherry picked from commit 4c4a018caba30a58c3549924b8521074bbe5adad)
(cherry picked from commit 29cba5c9efca1aa2a972ec2fe38709e6ceb7f3ec)

5 years agoadd "list" verb to autocompleted commands
Olivier Le Moal [Thu, 27 Aug 2020 08:01:36 +0000 (10:01 +0200)]
add "list" verb to autocompleted commands

(cherry picked from commit 50574ed1ac2e27d8f25894c9db75bb0b4c28978f)
(cherry picked from commit e1ce367d73c82f6e7fd373fb3dd9892662f3f44a)

5 years agoshell-completion/zsh: add missing verbs for networkctl
Olivier Le Moal [Wed, 26 Aug 2020 14:03:35 +0000 (16:03 +0200)]
shell-completion/zsh: add missing verbs for networkctl

(cherry picked from commit 6ff45bc1a18855cb9b0c43ba13843c11dd10728f)
(cherry picked from commit 1f4cb5da1eb5970726a90262a8a3342906743436)

5 years agopath: Improve $PATH search directory case
Chris Down [Wed, 26 Aug 2020 17:49:27 +0000 (18:49 +0100)]
path: Improve $PATH search directory case

Previously:

1. last_error wouldn't be updated with errors from is_dir;
2. We'd always issue a stat(), even for binaries without execute;
3. We used stat() instead of access(), which is cheaper.

This change avoids all of those, by only checking inside X_OK-positive
case whether access() works on the path with an extra slash appended.
Thanks to Lennart for the suggestion.

(cherry picked from commit 33e1a5d8d3f792e1d98377fe439e123231032ec7)
(cherry picked from commit a4236a27644705e58836f5d547d5aef50d568c11)

5 years agopath: Skip directories when finalising $PATH search
Chris Down [Tue, 25 Aug 2020 20:59:11 +0000 (21:59 +0100)]
path: Skip directories when finalising $PATH search

Imagine $PATH /a:/b. There is an echo command at /b/echo. Under this
configuration, this works fine:

    % systemd-run --user --scope echo .
    Running scope as unit: run-rfe98e0574b424d63a641644af511ff30.scope
    .

However, if I do `mkdir /a/echo`, this happens:

    % systemd-run --user --scope echo .
    Running scope as unit: run-rcbe9369537ed47f282ee12ce9f692046.scope
    Failed to execute: Permission denied

We check whether the resulting file is executable for the performing
user, but of course, most directories are anyway, since that's needed to
list within it. As such, another is_dir() check is needed prior to
considering the search result final.

Another approach might be to check S_ISREG, but there may be more gnarly
edge cases there than just eliminating this obviously pathological
example, so let's just do this for now.

(cherry picked from commit 8b5cb69bc8b70d1dcc39ed2165907723099bd9d8)
(cherry picked from commit b7cef386bd1bc810f5bb12d84c2ec4d6428231e3)

5 years agorules: don't install 80-drivers.rules when kmod is disabled
Alec Moskvin [Sat, 1 Aug 2020 13:25:05 +0000 (09:25 -0400)]
rules: don't install 80-drivers.rules when kmod is disabled

(cherry picked from commit dd47b25220f69f869679089da5cc848cf9cd0c78)
(cherry picked from commit 122945f315c8ccb1ecaf8384aff85931791d45d3)

5 years agozsh: correct journalctl command completion parsing
Ronan Pigott [Tue, 25 Aug 2020 02:33:37 +0000 (19:33 -0700)]
zsh: correct journalctl command completion parsing

(cherry picked from commit 45b156c1559da468f1c12aa5170858574c9b5831)
(cherry picked from commit 42fab2d454a33f11d545db1d5e90d73deaf4dd9e)

5 years agobasic/missing_syscall: fix syscall numbers for arm64 :(
Zbigniew Jędrzejewski-Szmek [Sat, 22 Aug 2020 14:55:56 +0000 (16:55 +0200)]
basic/missing_syscall: fix syscall numbers for arm64 :(

(cherry picked from commit b6ce3d2c0152a17210bb7fd31bb92a289f181a57)
(cherry picked from commit ed3f97f9625f6349045a4b80581bbf76cc4fcdbd)

5 years agoshared/install: fix preset operations for non-service instantiated units
Zbigniew Jędrzejewski-Szmek [Sat, 22 Aug 2020 09:58:15 +0000 (11:58 +0200)]
shared/install: fix preset operations for non-service instantiated units

Fixes https://github.com/coreos/ignition/issues/1064.

(cherry picked from commit 47ab95fe4315b3f7ee5a3694460a744bb88c52fd)
(cherry picked from commit ba6e7f7c46d916a7eacddc17edb8be3e4f4dd67e)

5 years agonss-resolve: treat BUS_ERROR_NO_SUCH_UNIT the same as SD_BUS_ERROR_SERVICE_UNKNOWN too
Zbigniew Jędrzejewski-Szmek [Sat, 22 Aug 2020 16:48:43 +0000 (18:48 +0200)]
nss-resolve: treat BUS_ERROR_NO_SUCH_UNIT the same as SD_BUS_ERROR_SERVICE_UNKNOWN too

Seems safer to do so.

(cherry picked from commit 8e34f4cc62aaeaa8881a1d6cd9136de5a22777a1)
(cherry picked from commit d39f1393489f26a3a759fbf27f1b8e75d15939a2)

5 years agovarious: treat BUS_ERROR_NO_SUCH_UNIT the same as SD_BUS_ERROR_SERVICE_UNKNOWN
Zbigniew Jędrzejewski-Szmek [Sat, 22 Aug 2020 16:48:03 +0000 (18:48 +0200)]
various: treat BUS_ERROR_NO_SUCH_UNIT the same as SD_BUS_ERROR_SERVICE_UNKNOWN

We return BUS_ERROR_NO_SUCH_UNIT a.k.a. org.freedesktop.systemd1.NoSuchUnit
in various places. In #16813:
Aug 22 06:14:48 core sudo[2769199]: pam_systemd_home(sudo:account): Failed to query user record: Unit dbus-org.freedesktop.home1.service not found.
Aug 22 06:14:48 core dbus-daemon[5311]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.home1.service': Unit dbus-org.freedesktop.home1.service not found.
Aug 22 06:14:48 core dbus-daemon[5311]: [system] Activating via systemd: service name='org.freedesktop.home1' unit='dbus-org.freedesktop.home1.service' requested by ':1.6564' (uid=0 pid=2769199 comm="sudo su ")

This particular error comes from bus_unit_validate_load_state() in pid1:
  case UNIT_NOT_FOUND:
       return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s not found.", u->id);

It seems possible that we should return a different error, but it doesn't really
matter: if we change pid1 to return a different error, we still need to handle
BUS_ERROR_NO_SUCH_UNIT as in this patch to handle pid1 with current code.

(cherry picked from commit 73d3ac8e2440cda3b7f2310f329f0798de6c041c)
(cherry picked from commit 9bb3e64d715684865a1eb3c1ded60cf36d0d1cf2)

5 years agoman: drop reference to long gone .busname unit type
Lennart Poettering [Mon, 24 Aug 2020 17:41:09 +0000 (19:41 +0200)]
man: drop reference to long gone .busname unit type

Seems we missed one occurence.

(cherry picked from commit 68dd195c1b8fdba3fccf166a1c3c2d7ca5a912fe)
(cherry picked from commit 6d802dd5968a8265c4d0e0e4974135cbcb9c9f14)

5 years agoman: fix a fix of a typo in systemd.service example
Jan Chren [Mon, 24 Aug 2020 14:40:11 +0000 (16:40 +0200)]
man: fix a fix of a typo in systemd.service example

The fix from cb263973acf83de22a86f08fe502a9cbd6c01d2b was made the other way around,
i.e. `SIGKILL` was changed to `SIGUSR1`, but the sentence is about a "termination signal", i.e. `SIGKILL`, not `SIGUSR1`.

(cherry picked from commit be3f62faf5d498aaab4cf6ceb3ca56e0d994ddf5)
(cherry picked from commit a29656804b51b957e6bfedee0bb92df327c1b45a)

5 years agoman: fix invalid tag place
Yu Watanabe [Fri, 21 Aug 2020 06:30:05 +0000 (15:30 +0900)]
man: fix invalid tag place

(cherry picked from commit d91b9bbce881c7e0d2ee80208325be59924b0e8f)
(cherry picked from commit 0d8000522bca55bdfbaafd5690d3e0af9d54ee7b)

5 years agouser-runtime-dir: deal gracefully with missing logind properties
Lennart Poettering [Wed, 19 Aug 2020 15:05:44 +0000 (17:05 +0200)]
user-runtime-dir: deal gracefully with missing logind properties

Fixes: #16685
(cherry picked from commit 5d1e68b49489574ef57947c5f1adfc761547eea9)
(cherry picked from commit 6cd058f305dce7aa6b20d88496b80a5dd25745d3)

5 years agoshared/seccomp: do not use ifdef guards around textual syscall names
Zbigniew Jędrzejewski-Szmek [Tue, 18 Aug 2020 14:10:47 +0000 (16:10 +0200)]
shared/seccomp: do not use ifdef guards around textual syscall names

It is possible that we will be running with an upgraded libseccomp, in which
case libseccomp might know the syscall name, even if the number is not known at
the time when systemd is being compiled. The guard only serves to break such
upgrades, by requiring that we also recompile systemd.

For s390-specific syscalls, use a define to exclude them, so that that we don't
try to filter them on other arches.

(cherry picked from commit 6da432fd542af5553742b905a0f87a825a28a399)
(cherry picked from commit 6a2d73638d8c710676107aedd7ad02abcb47975d)

5 years agomachine-id-setup: don't use KVM or container manager supplied uuid if in chroot env
Lennart Poettering [Wed, 19 Aug 2020 15:07:41 +0000 (17:07 +0200)]
machine-id-setup: don't use KVM or container manager supplied uuid if in chroot env

Fixes: #16758
(cherry picked from commit 1f894e682cb34d8d713378d01dc0565b7b5a245f)
(cherry picked from commit 7355ac9689e9213e0d4a1f1ed7f41e736842ec5c)

5 years agoman: Fix typo in systemd-tmpfiles
Phaedrus Leeds [Wed, 19 Aug 2020 16:36:32 +0000 (09:36 -0700)]
man: Fix typo in systemd-tmpfiles

(cherry picked from commit c2892a244c82ee142089f8fb7848547dada4ed32)
(cherry picked from commit 496a71f44483c54a2aa9569d2be5aceaa015664a)

5 years agohomed: downgrade quota message in containers
Lennart Poettering [Mon, 17 Aug 2020 16:19:30 +0000 (18:19 +0200)]
homed: downgrade quota message in containers

quota syscalls and operations are typically prohibited in containers.
Let's not make noise about that, needlessly.

(cherry picked from commit 5e5e11b8744fbe9dcd87a2d165f342dc9bcd4008)
(cherry picked from commit 84e1ab74d274de2a43bfa4f67a81da97635fd27c)

5 years agoanalyze-security: do not assign badness to filtered-out syscalls
Zbigniew Jędrzejewski-Szmek [Sat, 1 Aug 2020 09:28:09 +0000 (11:28 +0200)]
analyze-security: do not assign badness to filtered-out syscalls

Fixes #16451, https://bugzilla.redhat.com/show_bug.cgi?id=1856273.

(cherry picked from commit 01ecb3674ad3650bcbb14155b2dcbd4b9f4ed57e)
(cherry picked from commit 8b62cadf368cf017ad3c7921e6b39ddd664f74e2)

5 years agoload-fragment: fix grammar in error messages
Alyssa Ross [Tue, 18 Aug 2020 20:56:59 +0000 (20:56 +0000)]
load-fragment: fix grammar in error messages

(cherry picked from commit 556a7bbed607ec8cbbf4affc5d862ef92403418e)
(cherry picked from commit 76331f86f630bd884f2e16a36d66c55b2b22c8e1)

5 years agomissing_syscall: do not use function name that may conflict with glibc
Zbigniew Jędrzejewski-Szmek [Sun, 16 Aug 2020 14:19:29 +0000 (16:19 +0200)]
missing_syscall: do not use function name that may conflict with glibc

This was done for all replacements back in 5187dd2c403caf92d09f3491e41f1ceb3f10491f,
but some newer stuff didn't do this.

(cherry picked from commit faeae444ea452139519718ceb681e8b5831b6890)
(cherry picked from commit a2a3f16cdc16d32e1c685bbd469fb74b9aabdd71)

5 years agomissing_syscall: fix pidfd_{send_signal,open} numbers for alpha
Zbigniew Jędrzejewski-Szmek [Sat, 15 Aug 2020 17:01:23 +0000 (19:01 +0200)]
missing_syscall: fix pidfd_{send_signal,open} numbers for alpha

Also order the syscalls by syscall number for easier comparisons with the
kernel headers.

Fixup for 5f152f43d04e5aad6a3f98f45f020a66e3aac717.

(cherry picked from commit 23654cee136862996d92e7f1e9887786ddb3dfe6)
(cherry picked from commit 4091dcd4699cc04d59068f86fa6d5e6c578e4eca)

5 years agotest: accept that char device 0/0 can now be created witout privileges
Lennart Poettering [Fri, 14 Aug 2020 19:50:55 +0000 (21:50 +0200)]
test: accept that char device 0/0 can now be created witout privileges

Fixes: #16721
(cherry picked from commit 5b5ce6298e5a1c09beacd5c963e2350979cbf94a)
(cherry picked from commit f44ec1de15ca64babe4d6686765333b326036cb8)

5 years agotools/make-man-index: fix purpose text that contains tags
Haochen Tong [Sun, 16 Aug 2020 01:28:46 +0000 (03:28 +0200)]
tools/make-man-index: fix purpose text that contains tags

(cherry picked from commit f3317336450e1145b97ae9e38bd626f3d4c88eb8)
(cherry picked from commit 946e4c43bb4ac189259b3cbc035400ca90a8148f)

5 years agoNewer Glibc use faccessat2 to implement faccessat
Michael Scherer [Sat, 15 Aug 2020 16:12:02 +0000 (18:12 +0200)]
Newer Glibc use faccessat2 to implement faccessat

cf https://repo.or.cz/glibc.git/commit/3d3ab573a5f3071992cbc4f57d50d1d29d55bde2

This cause breakage on Fedora Rawhide: https://bugzilla.redhat.com/show_bug.cgi?id=1869030

(cherry picked from commit bcf08acbffdee0d6360d3c31d268e73d0623e5dc)
(cherry picked from commit 0d026c9b0d2fbf62d0a69aa1715ccb4f7c6dc2fe)

5 years agoman: fix incorrectly placed full stop
Lennart Poettering [Tue, 11 Aug 2020 12:50:32 +0000 (14:50 +0200)]
man: fix incorrectly placed full stop

(cherry picked from commit 6b49257f6b92c1bcdf02ca0e896009da36ed9bb0)
(cherry picked from commit 208ba581f44fe573f8c0e23025b639e402959149)

5 years agobless-boot: add missing verb to --help
Zbigniew Jędrzejewski-Szmek [Wed, 5 Aug 2020 10:16:03 +0000 (12:16 +0200)]
bless-boot: add missing verb to --help

There is also "help" verb which duplicates the --help option. I don't
think we should advertise it.

(cherry picked from commit ddd8e23dc9d6ab33b3b3c243369042a325ba618d)
(cherry picked from commit 53a8d2588e72cd6af930ae32b9590cf2d92c6da5)

5 years agouser-record: deal with invalid GECOS fields gracefully
Lennart Poettering [Thu, 6 Aug 2020 15:00:07 +0000 (17:00 +0200)]
user-record: deal with invalid GECOS fields gracefully

Let's fix up invalid GECOS fields both when we convert from NSS to JSON
and the other way round.

Kinda sucks we have to do that, but NSS does it when writing data to
/etc/passwd, so let's do the same.

Fixes: #16668
(cherry picked from commit 5cd12abaa0c0f3a06c9ff2048941fbe6e8b3577e)
(cherry picked from commit 4cfa0ac4fdc4e404f8361785c60c9f6061152d2f)

5 years agouser-util: add mangle_gecos() call for turning strings into fields suitable as GECOS...
Lennart Poettering [Thu, 6 Aug 2020 14:46:18 +0000 (16:46 +0200)]
user-util: add mangle_gecos() call for turning strings into fields suitable as GECOS fields

(cherry picked from commit b10fd796f56e4f16f7430cd22f59f544766d3bef)
(cherry picked from commit ae5234ef483801bd12c465dfaba6d63bf286eac0)

5 years agofix typo in systemctl help
Matt Fenwick [Fri, 7 Aug 2020 14:43:11 +0000 (10:43 -0400)]
fix typo in systemctl help

(cherry picked from commit c1c28fe2f70573270b0544670dba38b3a2f06c13)
(cherry picked from commit 972391ac396f8fa39d06773338605af5a9d5507d)

5 years ago_sd-common.h: avoid parsing errors with Coverity
Kamil Dudka [Wed, 5 Aug 2020 21:53:40 +0000 (23:53 +0200)]
_sd-common.h: avoid parsing errors with Coverity

The commit 1070d271fa8fa553d57dd5f74dd1e3f60732d0b9 which was supposed
too fix this does not seem to take effect any more.  We get again 34%
compilation success rate while scanning systemd itself.  Moreover, the
installed header file breaks compilation of programs that include it:

"/usr/include/systemd/_sd-common.h", line 23: error #35: #error directive: "Do
          not include _sd-common.h directly; it is a private header."
  #  error "Do not include _sd-common.h directly; it is a private header."
     ^

(cherry picked from commit 4191b3282afbca9f1ef333f91bb6566c374da1fe)
(cherry picked from commit 5aec8fe54e47dbffc9ed705e4211f935bdca1550)

5 years agoanalyze: fix 'cat-config systemd/zram-generator.conf'
Zbigniew Jędrzejewski-Szmek [Sat, 1 Aug 2020 10:25:56 +0000 (12:25 +0200)]
analyze: fix 'cat-config systemd/zram-generator.conf'

Also makes this work for various systemd config files that support .d.

(cherry picked from commit 28365e88d0dfc6332b26120e23b2c39b7958f907)
(cherry picked from commit f9ad4ea2ca06e7067da269743d6f7d70b9ae4864)

5 years agoman: describe that changing Storage= does not move existing data
Zbigniew Jędrzejewski-Szmek [Mon, 3 Aug 2020 11:22:01 +0000 (13:22 +0200)]
man: describe that changing Storage= does not move existing data

Fixes #16384.

(cherry picked from commit f254abcd72b6ca6c4567c245a7dbaf739d02dfc2)
(cherry picked from commit dda6fec1dfc73d974827bbb540a043fc3ec76b18)