Christopher Obbard [Wed, 2 Dec 2020 14:20:39 +0000 (14:20 +0000)]
virt: Properly detect nested UML inside another hypervisor
UML runs as a user-process so it can quite easily be ran inside of
another hypervisor, for instance inside a KVM instance. UML passes
through the CPUID from the host machine so in this case detect_vm
incorrectly identifies as running under KVM. So check we are running
a UML kernel first, before we check any other hypervisors.
Resolves: #17754
Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
(cherry picked from commit
c8037dbf05da586b6a210ac04f145d99f424971f)
Lennart Poettering [Tue, 17 Nov 2020 17:31:53 +0000 (18:31 +0100)]
resolved: properly check per-link NTA list
We need to check for parent domains too. We did this correctly for the
system-wide NTA list, but not for the per-link one. Let's fix that.
(cherry picked from commit
7e8a93b77c3c4d4df1e8c3177dc9553c94fac759)
Yu Watanabe [Wed, 2 Dec 2020 09:05:06 +0000 (18:05 +0900)]
igo95862 [Fri, 27 Nov 2020 13:51:18 +0000 (16:51 +0300)]
man: Speicfy exact return values of sd_bus_message_enter_container
(cherry picked from commit
1edc1f1b626446a20db405d041cd70ed3d52c632)
Yu Watanabe [Thu, 26 Nov 2020 23:18:32 +0000 (08:18 +0900)]
network: fix return values
(cherry picked from commit
72f092815ada28431103d2145ffa61e1ae14aded)
Zbigniew Jędrzejewski-Szmek [Thu, 26 Nov 2020 10:23:54 +0000 (11:23 +0100)]
shared/seccomp-util: address family filtering is broken on ppc
This reverts the gist of
da1921a5c396547261c8c7fcd94173346eb3b718 and
0d9fca76bb69e162265b2d25cb79f1890c0da31b (for ppc).
Quoting #17559:
> libseccomp 2.5 added socket syscall multiplexing on ppc64(el):
> https://github.com/seccomp/libseccomp/pull/229
>
> Like with i386, s390 and s390x this breaks socket argument filtering, so
> RestrictAddressFamilies doesn't work.
>
> This causes the unit test to fail:
> /* test_restrict_address_families */
> Operating on architecture: ppc
> Failed to install socket family rules for architecture ppc, skipping: Operation canceled
> Operating on architecture: ppc64
> Failed to add socket() rule for architecture ppc64, skipping: Invalid argument
> Operating on architecture: ppc64-le
> Failed to add socket() rule for architecture ppc64-le, skipping: Invalid argument
> Assertion 'fd < 0' failed at src/test/test-seccomp.c:424, function test_restrict_address_families(). Aborting.
>
> The socket filters can't be added so `socket(AF_UNIX, SOCK_DGRAM, 0);` still
> works, triggering the assertion.
Fixes #17559.
(cherry picked from commit
d5923e38bc0e6cf9d7620ed5f1f8606fe7fe1168)
Dan Streetman [Wed, 25 Nov 2020 20:22:24 +0000 (15:22 -0500)]
test: use cap_last_cap() for max supported cap number, not capability_list_length()
This test assumes capability_list_length() is an invalid cap number,
but that isn't true if the running kernel supports more caps than we were
compiled with, which results in the test failing.
Instead use cap_last_cap() + 1.
If cap_last_cap() is 63, there are no more 'invalid' cap numbers to test with,
so the invalid cap number test part is skipped.
(cherry picked from commit
ebc815cd1c647faa934a446ceea91ff4bc9dffa4)
Yu Watanabe [Wed, 25 Nov 2020 13:20:48 +0000 (22:20 +0900)]
man: slightly update the man page of sd_bus_message_read_basic()
Follow-up for
73a1d7d2433edd1872ec53db3e804009298ebb1d.
(cherry picked from commit
7a1fe27f81dace11a25a0573dc170d86d1f92023)
igo95862 [Wed, 25 Nov 2020 13:15:33 +0000 (16:15 +0300)]
man: Fixed an incomplete sentence
(cherry picked from commit
78c4f2f153b93fdb39654edb93a73b202a67dcfd)
igo95862 [Wed, 25 Nov 2020 12:53:52 +0000 (15:53 +0300)]
man: Specify that sd_bus_message_read_basic returns 0 if end of array had been reached.
(cherry picked from commit
73a1d7d2433edd1872ec53db3e804009298ebb1d)
Yu Watanabe [Tue, 17 Nov 2020 00:13:59 +0000 (09:13 +0900)]
core/mount: mount command may fail after adding the corresponding proc mountinfo entry
Hopefully fixes #17617.
(cherry picked from commit
2fa0bd7d57863dffda89190a70a83c51bd7d114a)
Lennart Poettering [Tue, 17 Nov 2020 17:35:08 +0000 (18:35 +0100)]
mkosi: make sure our mkosi files work with f33
(cherry picked from commit
e2c5e698c094165919af8d5f91896425c918c850)
Pavel Sapezhko [Wed, 18 Nov 2020 14:54:01 +0000 (17:54 +0300)]
man: clarify DefaultTasksMax doc
(cherry picked from commit
77f5277a7abf7d6b0a4bbf4ecf872da0b92335b5)
Yu Watanabe [Tue, 24 Nov 2020 09:47:37 +0000 (18:47 +0900)]
seccomp: also move munmap into @default syscall filter set
Follow-up for
5abede3247591248718026cb8be6cd231de7728b.
(cherry picked from commit
11b9105dfdbcea5dc9f4a5dd676ca494ab8b909e)
INSUN PYO [Thu, 19 Nov 2020 01:49:04 +0000 (10:49 +0900)]
sd-device-enumerator: do not return error when a device is removed
If /sys/class/OOO node is created and destroyed during booting (kernle driver initialization fails),
systemd-udev-trigger.service fails due to race condition.
***** race condition ***********************************************************************************
1. kernel driver create /sys/class/OOO
2. systemd-udev-trigger.service execues "/usr/bin/udevadm trigger --type=devices --action=add"
3. device_enumerator_scan_devices() => enumerator_scan_devices_all() => enumerator_scan_dir("class") =>
opendir("/sys/class") and iterate all subdirs ==> enumerator_scan_dir_and_add_devices("/sys/class/OOO")
4. kernel driver fails and destroy /sys/class/OOO
5. enumerator_scan_dir_and_add_devices("/sys/class/OOO") fails in opendir("/sys/class/OOO")
6. "systemd-udev-trigger.service" fails
7. udev coldplug fails and some device units not ready
8. mount units asociated with device units fail
9. local-fs.target fails
10. enters emergency mode
********************************************************************************************************
***** status of systemd-udev-trigger.service unit ******************************************************
$ systemctl status systemd-udev-trigger.service
systemd-udev-trigger.service - udev Coldplug all Devices
Loaded: loaded (/usr/lib/systemd/system/systemd-udev-trigger.service; static; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2020-01-02 13:16:54 KST; 22min ago
Docs: man:udev(7)
man:systemd-udevd.service(8)
Process: 2162 ExecStart=/usr/bin/udevadm trigger --type=subsystems --action=add (code=exited, status=0/SUCCESS)
Process: 2554 ExecStart=/usr/bin/udevadm trigger --type=devices --action=add (code=exited, status=1/FAILURE)
Main PID: 2554 (code=exited, status=1/FAILURE)
Jan 02 13:16:54 localhost udevadm[2554]: Failed to scan devices: No such file or directory
Jan 02 13:16:54 localhost systemd[1]: systemd-udev-trigger.service: Main process exited, code=exited, status=1/FAILURE
Jan 02 13:16:54 localhost systemd[1]: systemd-udev-trigger.service: Failed with result 'exit-code'.
Jan 02 13:16:54 localhost systemd[1]: Failed to start udev Coldplug all Devices.
*******************************************************************************************************
***** journal log with Environment=SYSTEMD_LOG_LEVEL=debug in systemd-udev-trigger.service ***********
Jan 01 21:57:20 localhost udevadm[2039]: sd-device-enumerator: Scanning /sys/bus
Jan 01 21:57:20 localhost udevadm[2522]: sd-device-enumerator: Scan all dirs
Jan 01 21:57:20 localhost udevadm[2522]: sd-device-enumerator: Scanning /sys/bus
Jan 01 21:57:21 localhost udevadm[2522]: sd-device-enumerator: Scanning /sys/class
Jan 01 21:57:21 localhost udevadm[2522]: sd-device-enumerator: Failed to scan /sys/class: No such file or directory
Jan 01 21:57:21 localhost udevadm[2522]: Failed to scan devices: No such file or directory
*******************************************************************************************************
(cherry picked from commit
cfb6197bc31eb6b2631dec7bf8d7a253e7891016)
Etienne Doms [Fri, 20 Nov 2020 16:15:25 +0000 (17:15 +0100)]
curl-util: fix callback prototype
CURLMOPT_SOCKETFUNCTION callback is an easy handle, not a multi.
(cherry picked from commit
5b639090d0b4a49d77ba58bebe180b2a6f8da322)
Yu Watanabe [Fri, 20 Nov 2020 16:51:03 +0000 (01:51 +0900)]
curl-util: fix type CURL -> CURLM
(cherry picked from commit
2d052a0a48cc184ea3748c2e364c661985aa21d5)
Franck Bui [Fri, 20 Nov 2020 10:52:36 +0000 (11:52 +0100)]
units: restore sysfs conditions in sys-fs-fuse-connections.mount and sys-kernel-config.mount
Commit
42cc2855ba2fe4c6f5d incorrectly removed the condition on sysfs in both
sys-fs-fuse-connections.mount and sys-kernel-config.mount. However there are
still needed in case modprobe of one of these modules is intentionally skipped
(due to lack of privs for example).
This patch restores the 2 conditions which should be safe for the common case,
since all conditions are only checked after all deps ordered before are
complete.
Follow-up for
42cc2855ba2fe4c6f5dc863507a1c843611350a0.
(cherry picked from commit
07ccf434e77b17b20d773ce8b2637083cd4fdafc)
Yu Watanabe [Tue, 17 Nov 2020 01:50:12 +0000 (10:50 +0900)]
core/mount: mount_start() may be called during the state is MOUNT_MOUNTING_DONE
As, both MOUNT_MOUNTING and MOUNT_MOUNTING_DONE are mapped to
UNIT_ACTIVATING.
Fixes #17570.
(cherry picked from commit
db39a62784e8f857a67cb4a83ade28a906f79679)
Lennart Poettering [Thu, 19 Nov 2020 10:14:41 +0000 (11:14 +0100)]
seccomp: move brk+mmap+mmap2 into @default syscall filter set
These three syscalls are internally used by libc's memory allocation
logic, i.e. ultimately back malloc(). Allocating a bit of memory is so
basic, it should just be in the default set.
This fixes a couple of issues with asan/msan and the seccomp tests: when
asan/msan is used some additional, large memory allocations take place
in the background, and unless mmap/mmap2/brk are allowlisted these will
fail, aborting the test prematurely.
(cherry picked from commit
5abede3247591248718026cb8be6cd231de7728b)
Franck Bui [Thu, 19 Nov 2020 08:17:19 +0000 (09:17 +0100)]
units: wait until some fs modules are entirely loaded before mounting their corresponding filesystem
udev requests to start the fs mount units when their respective module is
loaded. For that it monitors uevents of type "ADD" for the relevant fs modules.
However the uevent is sent by the kernel too early, ie before the init() of the
module is called hence before directories in /sys/fs/ are created.
This patch workarounds adds "Requires/After=modprobe@<fs-module>.service" to
the mount unit, which means that modprobe(8) will be called once the fs module
is announced to be loaded. This sounds pointless, but given that modprobe only
returns after the initialization of the module is complete, it should
workaround the issue.
As a side effect, the module will be automatically loaded if the mount unit is
started manually.
Fixes #17586.
(cherry picked from commit
42cc2855ba2fe4c6f5dc863507a1c843611350a0)
Franck Bui [Thu, 19 Nov 2020 07:55:56 +0000 (08:55 +0100)]
Revert "units: skip modprobe@.service if the unit appears to be already loaded"
This reverts commit
9cbf1e58f9629af5c6b56777ee73dc6320306d6d.
The presence of /sys/module/%I directory can't be used to assert that the load
of a given module is complete and therefore the call to modprobe(8) can be
skipped. Indeed this directory is created before the init() function of the
module is called.
Users of modprobe@.service needs to be sure that once this service returns the
module is fully operational.
(cherry picked from commit
b3e32582f67c68896b6b05893b138a975fa26454)
Yu Watanabe [Wed, 18 Nov 2020 07:43:58 +0000 (16:43 +0900)]
khash: fix structured initializer
Fixes #17646.
(cherry picked from commit
f56a9cbf9c20cd798258d3db302d51bf21458b38)
igo95862 [Wed, 18 Nov 2020 09:21:37 +0000 (12:21 +0300)]
man: Fix sd_bus_message_append_array_space function signature
(cherry picked from commit
0e577869f3fc287223d31cfed52921c4d3579ff2)
Yu Watanabe [Mon, 16 Nov 2020 15:51:14 +0000 (00:51 +0900)]
sd-device: drop unwanted newline in netlink message
(cherry picked from commit
b9cbb08e0a35070d57721cd5bf810659a0b80f5e)
Zbigniew Jędrzejewski-Szmek [Tue, 17 Nov 2020 10:46:50 +0000 (11:46 +0100)]
man: drop misplaced phrase
I think it was added in
6c2b9c8da1eb1bac7e8f170b913f63dbd13a16d7 as c&p.
(cherry picked from commit
de70ff66dc628062d4f04270988b92ba0aef2420)
igo95862 [Tue, 17 Nov 2020 09:47:28 +0000 (12:47 +0300)]
man: Add a paragraph to sd_bus_call explaning callback message lifetime
(cherry picked from commit
e6ce785d611702532ae71547e78fbb49eff3aded)
Yu Watanabe [Sat, 14 Nov 2020 20:13:55 +0000 (05:13 +0900)]
man: fix prototpe of sd_bus_message_peek_type()
Fixes #17609.
(cherry picked from commit
483abcc65bd5efe43b0cea453580bac45cd0f177)
Yu Watanabe [Sat, 14 Nov 2020 20:10:10 +0000 (05:10 +0900)]
man: add missing <para> tag, and drop redundant ">"
Fixes #17609.
(cherry picked from commit
e55c073161d469fb01ecd5bea3ff8845194e25d9)
igo95862 [Tue, 17 Nov 2020 07:54:19 +0000 (10:54 +0300)]
man: Separated paragraph about making sd_bus object reply async
(cherry picked from commit
2e4238a6d14223728dbfbb24830e644d31b04111)
Yu Watanabe [Fri, 13 Nov 2020 06:55:54 +0000 (15:55 +0900)]
meson: use "_" as separator in test names
Follow-up for
ca121e20c42219e3bc4e5cb63dcc96cc5eae2879.
Fixes #17568.
(cherry picked from commit
d448888924c1d4815cb97bcd5d94419812c053b9)
Yu Watanabe [Fri, 13 Nov 2020 05:58:49 +0000 (14:58 +0900)]
missing: define several syscall numbers for MIPS arch
Fixes #17591.
(cherry picked from commit
77419ba463999a25922146ac424348adc2fe23af)
Christof Efkemann [Sun, 15 Nov 2020 19:08:39 +0000 (20:08 +0100)]
networkd: fix default value of DHCPv6Client
The configuration of networkd has a DHCPv6Client setting in its
[IPv6AcceptRA] section, which, according to the man page, can be
a boolean, or the special value "always". The man page states
that "true" is the default.
The default value is implemented in src/network/networkd-network.c
by setting field ipv6_accept_ra_start_dhcp6_client of network to
true. However, this field is not a boolean, but an enum type
IPv6AcceptRAStartDHCP6Client (src/network/networkd-ndisc.h).
Setting ipv6_accept_ra_start_dhcp6_client to true effectively
corresponds to the enum value IPV6_ACCEPT_RA_START_DHCP6_CLIENT_ALWAYS,
resulting in the DHCPv6Client setting having the default value
"always".
This patch changes the initialisation to the correct enum value
IPV6_ACCEPT_RA_START_DHCP6_CLIENT_YES.
(cherry picked from commit
cabe57119f07a9f86ab281f6260bbb006b89a854)
Etienne Doms [Thu, 12 Nov 2020 10:09:54 +0000 (11:09 +0100)]
ratelimit: fix integer overflow
If StartLimitIntervalSec is huge, or more specifically, set to "infinity", we need to take care about overflows.
(cherry picked from commit
e2357b1c8a87b610066b8b2a59517bcfb20b832e)
Yu Watanabe [Mon, 9 Nov 2020 21:10:16 +0000 (06:10 +0900)]
man: fix tag
(cherry picked from commit
af7ce3faf88f6bcd5c82a71412fa81e8ae34acbb)
Yu Watanabe [Mon, 9 Nov 2020 20:57:41 +0000 (05:57 +0900)]
man: mention that sd_bus_call() may return a negative errno mapped from D-Bus error reply
Closes #17556.
(cherry picked from commit
c660668ed9daf15358c522c09ba3932393bd5451)
Yu Watanabe [Mon, 9 Nov 2020 20:25:29 +0000 (05:25 +0900)]
man: add missing period
(cherry picked from commit
23243adf69ffed2630c778e021c3cf2e97a6b999)
Zbigniew Jędrzejewski-Szmek [Wed, 11 Nov 2020 13:37:07 +0000 (14:37 +0100)]
meson: use "_" as separator in test names
":" is prettier, but meson 0.56+ doesn't like it:
src/systemd/meson.build:73: DEPRECATION: ":" is not allowed in test name "cc-sd-bus.h:c", it has been replaced with "_"
src/systemd/meson.build:73: DEPRECATION: ":" is not allowed in test name "cc-sd-bus.h:c-ansi", it has been replaced with "_"
...
Fixes #17568.
(cherry picked from commit
ca121e20c42219e3bc4e5cb63dcc96cc5eae2879)
Yu Watanabe [Mon, 9 Nov 2020 16:14:38 +0000 (01:14 +0900)]
ethtool: make ethtool_get_driver() return -ENODATA if ioctl succeeds but driver name is empty
Inspired by #17532.
(cherry picked from commit
861de64e6858bc92b154ad70d1cee41ae5b75835)
Yu Watanabe [Mon, 9 Nov 2020 06:23:32 +0000 (15:23 +0900)]
journal: refuse skip parameter for sd_journal_next_skip() larger than INT_MAX
Fixes #17502.
(cherry picked from commit
41d544a1c124a63f94b571e5ed924c4fb03193bb)
Yu Watanabe [Mon, 9 Nov 2020 14:59:36 +0000 (23:59 +0900)]
core: add missing oom check
Fixes #17552.
(cherry picked from commit
72585a584d26eec4bb9ea6c30fc101f1e4f0d7f9)
Zbigniew Jędrzejewski-Szmek [Mon, 9 Nov 2020 14:39:29 +0000 (15:39 +0100)]
udev: log when we fail to query ID_NET_DRIVER
Inspired by #17532.
(cherry picked from commit
d61db498bf86fe64c66e30d15aafc020cc87d068)
Yu Watanabe [Mon, 9 Nov 2020 07:29:32 +0000 (16:29 +0900)]
network: make default router lifetime to 30min
Closes #17527.
(cherry picked from commit
71a5db49fd07864078348359200921d6d441f85a)
Yu Watanabe [Mon, 9 Nov 2020 05:33:16 +0000 (14:33 +0900)]
sd-bus: fix possible division by 0
Fixes #17541.
(cherry picked from commit
291bb0b01cae22c3c14882fd5a0ad557c92d9298)
Yu Watanabe [Mon, 9 Nov 2020 05:00:14 +0000 (14:00 +0900)]
home: fix copy-and-paste mistake
Fixes #17542.
(cherry picked from commit
755b35b1aa6eda16a2cf02be3e4aa44d08fc17a3)
Lennart Poettering [Fri, 6 Nov 2020 10:46:39 +0000 (11:46 +0100)]
resolved: slightly extend debug log output about outgoing messages
(cherry picked from commit
76f772298e3473f00eff7cb6dc294926a7d8cc4f)
Lennart Poettering [Thu, 5 Nov 2020 13:16:03 +0000 (14:16 +0100)]
resolved: don't resolve "local." via LLMNR
It's the mDNS top-level domain, hence don't consider it for LLMNR, ever.
Fixes: #16233
(cherry picked from commit
088648d081e9bc27f53c6471b91109569b29322f)
Lennart Poettering [Wed, 4 Nov 2020 20:01:49 +0000 (21:01 +0100)]
resolved: show all answer flags when dumping answer
(cherry picked from commit
5cdcac6cf6879826407433f2cfcf2b763f89d74a)
Lennart Poettering [Thu, 5 Nov 2020 14:49:15 +0000 (15:49 +0100)]
resolved: suppress misleading debug message about ignored resolv.conf line
(cherry picked from commit
02c205359b7dfcb4501cab564218f21d0a0523f8)
Lennart Poettering [Tue, 3 Nov 2020 19:34:21 +0000 (20:34 +0100)]
resolved: handle RRs where we don't have a signer
If we encounter an RR that has no matching signature, then we don't know
whether it was expanded from a wildcard or not. We need to accept that
and not make the NSEC test fail, just skip over the RR.
(cherry picked from commit
2f4c2db20ae02d750a6995e0afbff7231cd3a6b7)
Lennart Poettering [Tue, 3 Nov 2020 17:31:03 +0000 (18:31 +0100)]
resolved: put size limit in DnsAnswer size to UINT16_MAX
The three answer sections can only carry up to UINT16_MAX entries, hence
put a hard upper limit on how far DnsAnswer can grow. The three count
fields in the DNS packet header are 16 bit only, hence the limit.
If code actually tries to add more than 64K RRs it will get ENOSPC with
this new checking.
And similar to DnsQuestion.
(cherry picked from commit
398c611833584632c6977e2f89746403108637c7)
Lennart Poettering [Wed, 28 Oct 2020 13:54:12 +0000 (14:54 +0100)]
resolved: fix dumping of DnsAnswer objects
(cherry picked from commit
014e8cc131109e2a1995fcfe0550a77e6a9b42b2)
Lennart Poettering [Tue, 3 Nov 2020 17:06:47 +0000 (18:06 +0100)]
resolved: check return value of memdup() correctly for OOM
(cherry picked from commit
a63a1252b501f6c8b5a011825372977710e88e72)
Lennart Poettering [Thu, 29 Oct 2020 17:58:04 +0000 (18:58 +0100)]
man: remove misplaced comma
(cherry picked from commit
8b2e362651ca7f921ae9cd46a851f31eb2a7c903)
Jonathan Lebon [Tue, 27 Oct 2020 12:29:38 +0000 (13:29 +0100)]
units: unconditionally pull in remote-cryptsetup.target in the initramfs
[zjs: Replaces #17149.
I took half of the patch in
https://github.com/systemd/systemd/pull/17149#issuecomment-
698399194,
hence I'm keeping Jonathan's authorship.
The original reasoning for
6c5496c492a8d74e54d22bf8824160cab1e63c10 was that we
enable remote-cryptsetup.target via presets, and since presets are not used for
the initrd, we need a different target. But since parts of the unit and target
tree are shared between the initramfs and the main system, we can't just create
a separate target for the initramfs. All the targets that depend on this one
would need to be split also. That condition is true for initrd-fs.target, but
not for sysinit.target.
So let's instead just uncoditionally pull in remote-cryptsetup.target in the
initramfs. It should normally be empty, so there should be no impact on boots
that don't have units in the target.
Jonathan's patch used initrd-root-fs.target, this version instead uses
initrd-root-device.target. initrd-root-device.target is ordered before
sysroot.mount, which means that the decrypted devices will be available earlier
too.]
(cherry picked from commit
e921ebb57e0bc823ac167801cb5dd5f119f5d585)
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 09:49:11 +0000 (10:49 +0100)]
meson: simplify with_runlevels ternany op usage
(cherry picked from commit
d5816b6138be788f3d3ea72359bb28dc239c3235)
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 15:01:56 +0000 (16:01 +0100)]
man: update fedora version
F33 was released today!
(cherry picked from commit
d468c81e268adb2975faff2d8c8587b5640c15ae)
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 15:01:16 +0000 (16:01 +0100)]
man/machinectl: fix pull-raw example
We do not allow machine names with "_", so the command would fail as written.
Share the example with the systemd-nspawn page instead.
(cherry picked from commit
5fadff3352cfeb82844b6d475056bb18f2eba0dc)
Josh Brobst [Mon, 26 Oct 2020 22:45:51 +0000 (18:45 -0400)]
man: correct xdg-autostart-generator path
(cherry picked from commit
c690bd0bc6b2e07873cb289948ebd4dfa3a7e868)
Pat Coulthard [Sun, 25 Oct 2020 21:45:13 +0000 (16:45 -0500)]
tmpfiles: Handle filesystems without ACL support in more cases.
(cherry picked from commit
3045c416e1cbbd8ab40577790522217fd1b9cb3b)
Elias Probst [Sat, 24 Oct 2020 13:42:27 +0000 (15:42 +0200)]
NEWS: fix typo (`systemd-userdb` > `systemd-userdbd`)
(cherry picked from commit
a0223c308e869b51e4142c82f365ceb17b086adb)
Yu Watanabe [Tue, 13 Oct 2020 12:11:36 +0000 (21:11 +0900)]
Revert "sd-dhcp-client: use asynchronous_close()"
This effectively reverts the commit
22fc2420b2a7220addcee33c2fa17ada44d87f9c.
The function `asynchronous_close()` confuses valgrind. Before this commit,
valgrind may report the following:
```
HEAP SUMMARY:
in use at exit: 384 bytes in 1 blocks
total heap usage: 4,787 allocs, 4,786 frees, 1,379,191 bytes allocated
384 bytes in 1 blocks are possibly lost in loss record 1 of 1
at 0x483CAE9: calloc (vg_replace_malloc.c:760)
by 0x401456A: _dl_allocate_tls (in /usr/lib64/ld-2.31.so)
by 0x4BD212E: pthread_create@@GLIBC_2.2.5 (in /usr/lib64/libpthread-2.31.so)
by 0x499B662: asynchronous_job (async.c:47)
by 0x499B7DC: asynchronous_close (async.c:102)
by 0x4CFA8B: client_initialize (sd-dhcp-client.c:696)
by 0x4CFC5E: client_stop (sd-dhcp-client.c:725)
by 0x4D4589: sd_dhcp_client_stop (sd-dhcp-client.c:2134)
by 0x493C2F: link_stop_clients (networkd-link.c:620)
by 0x4126DB: manager_free (networkd-manager.c:867)
by 0x40D193: manager_freep (networkd-manager.h:97)
by 0x40DAFC: run (networkd.c:20)
LEAK SUMMARY:
definitely lost: 0 bytes in 0 blocks
indirectly lost: 0 bytes in 0 blocks
possibly lost: 384 bytes in 1 blocks
still reachable: 0 bytes in 0 blocks
suppressed: 0 bytes in 0 blocks
For lists of detected and suppressed errors, rerun with: -s
ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
```
(cherry picked from commit
5a8775bb39526696d01d0e2ffd64e9509644fff1)
Zbigniew Jędrzejewski-Szmek [Fri, 23 Oct 2020 13:47:33 +0000 (15:47 +0200)]
man: document what variables are allowed
(cherry picked from commit
0dc9fd56a53ef833fdc5b9b81bc958e7c3dd41a4)
Zbigniew Jędrzejewski-Szmek [Tue, 20 Oct 2020 08:50:01 +0000 (10:50 +0200)]
resolvectl: wrap the extended status string too
(cherry picked from commit
7d1e1afe28d554b2bbf95966990f8e07c361647d)
Zbigniew Jędrzejewski-Szmek [Mon, 12 Oct 2020 13:54:57 +0000 (15:54 +0200)]
resolvect: use wrapping for various lists
dump_list() is used for DNS servers, DNS domains, fallback DNS servers.
(cherry picked from commit
f08a64c5e10aed0a023e85ea664cc2f916fd6a23)
Zbigniew Jędrzejewski-Szmek [Mon, 12 Oct 2020 11:29:46 +0000 (13:29 +0200)]
format-table: add TABLE_STRV_WRAPPED
The idea is that we have strvs like list of server names or addresses, where
the majority of strings is rather short, but some are long and there can
potentially be many strings. So formattting them either all on one line or all
in separate lines leads to output that is either hard to read or uses way too
many rows. We want to wrap them, but relying on the pager to do the wrapping is
not nice. Normal text has a lot of redundancy, so when the pager wraps a line
in the middle of a word the read can understand what is going on without any
trouble. But for a high-density zero-redundancy text like an IP address it is
much nicer to wrap between words. This also makes c&p easier.
This adds a variant of TABLE_STRV which is wrapped on output (with line breaks
inserted between different strv entries).
The change table_print() is quite ugly. A second pass is added to re-calculate
column widths. Since column size is now "soft", i.e. it can adjust based on
available columns, we need to two passes:
- first we figure out how much space we want
- in the second pass we figure out what the actual wrapped columns
widths will be.
To avoid unnessary work, the second pass is only done when we actually have
wrappable fields.
A test is added in test-format-table.
(cherry picked from commit
b0e3d799891c4633bd2b0d88e4ed2c741bbcd532)
Zbigniew Jędrzejewski-Szmek [Sun, 11 Oct 2020 14:39:12 +0000 (16:39 +0200)]
format-table: reduce scope of iterator variables
(cherry picked from commit
6f8ca84c9b64c81add286790a7ffcc2eed569b27)
Zbigniew Jędrzejewski-Szmek [Sun, 11 Oct 2020 14:20:27 +0000 (16:20 +0200)]
resolvectl: use compat status string instead of a field-by-field table
The status string is modeled after our --version output: +enabled -disabled equals=more-info
For example:
Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=allow-downgrade/supported
(cherry picked from commit
fe37e5a5d192ec55f87cd57893688a865b7f72d2)
Zbigniew Jędrzejewski-Szmek [Sun, 11 Oct 2020 10:19:46 +0000 (12:19 +0200)]
resolvectl: sort domain/nta output
dns list shall not be sorted.
(cherry picked from commit
af781878d5986127ca00831c4b524c2b62649823)
Zbigniew Jędrzejewski-Szmek [Sun, 11 Oct 2020 11:46:53 +0000 (13:46 +0200)]
resolvectl: add the usual typedef for struct link_info/global_info
Also move the struct defintions up in preparation for further changes.
(cherry picked from commit
80b8c3d7fd90e1e1943873c54dafc9e3b88fca94)
Zbigniew Jędrzejewski-Szmek [Sun, 11 Oct 2020 10:55:10 +0000 (12:55 +0200)]
man: add example of negative trust anchor file
Fixes #17226.
(cherry picked from commit
2c91906e25ab0a4caa30f0bfaa1bdff6994cb9d9)
Zbigniew Jędrzejewski-Szmek [Sun, 11 Oct 2020 09:54:18 +0000 (11:54 +0200)]
resolvectl: break nta/domain/dns listings with newlines
We would print the whole string as a single super-long line. Let's nicely
break the text into lines that fit on the screen.
$ COLUMNS=70 build/resolvectl --no-pager nta
Global: home local intranet 23.172.in-addr.arpa lan
18.172.in-addr.arpa 16.172.in-addr.arpa 19.172.in-addr.arpa
25.172.in-addr.arpa 21.172.in-addr.arpa d.f.ip6.arpa
20.172.in-addr.arpa 30.172.in-addr.arpa 17.172.in-addr.arpa
internal 168.192.in-addr.arpa 28.172.in-addr.arpa
22.172.in-addr.arpa 24.172.in-addr.arpa 26.172.in-addr.arpa
corp 10.in-addr.arpa private 29.172.in-addr.arpa test
27.172.in-addr.arpa 31.172.in-addr.arpa
Link 2 (hub0):
Link 4 (enp0s31f6):
Link 5 (wlp4s0):
Link 7 (virbr0): adsfasdfasdfasd.com 21.172.in-addr.arpa lan j b
a.com home d.f.ip6.arpa b.com local 16.172.in-addr.arpa
19.172.in-addr.arpa 18.172.in-addr.arpa 25.172.in-addr.arpa
20.172.in-addr.arpa k i h 23.172.in-addr.arpa
168.192.in-addr.arpa d g intranet 17.172.in-addr.arpa c e.com
30.172.in-addr.arpa a f d.com e internal
Link 8 (virbr0-nic):
Link 9 (vnet0):
Link 10 (vb-rawhide):
Link 15 (wwp0s20f0u2i12):
(cherry picked from commit
7c5023037815228280dcf461bf9b9f2b3575f600)
Zbigniew Jędrzejewski-Szmek [Mon, 14 Sep 2020 07:01:48 +0000 (09:01 +0200)]
xdg-autostart-generator: use Type=exec
We check that the binary exists before writing the service file, but
let's also not consider the service started until the fork has happened.
This is still relatively new stuff, so we're can change the implementation
details like this.
(cherry picked from commit
67b2edb21f11d7b3bd2b5f8c88ceed4c5194c78a)
Zbigniew Jędrzejewski-Szmek [Mon, 14 Sep 2020 06:58:54 +0000 (08:58 +0200)]
test-path: use Type=exec
In general, Type=exec is superior to Type=simple. Let's not assume that
the service is started before it was really started.
(cherry picked from commit
333d102c644e7539b071ff5409d5a5e2dab35d65)
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 15:52:37 +0000 (17:52 +0200)]
man: document differences between nss-resolve and nss-dns
https://bugzilla.redhat.com/show_bug.cgi?id=
1889012
https://serverfault.com/questions/626612/dns-just-started-resolving-my-server-prod-addresses-to-127-0-53-53
https://serverfault.com/questions/649352/what-are-the-security-implications-of-the-allow-dns-suffix-appending-to-unquali
(cherry picked from commit
bace688394ab32d182f0624133f5db8367259402)
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 11:53:59 +0000 (13:53 +0200)]
man/org.freedesktop.resolve1: briefly document a bunch of methods and properties
Fixes #13799.
(cherry picked from commit
2ce493672cb9a42ff0960ed127a850a8abfd12d1)
Zbigniew Jędrzejewski-Szmek [Sun, 18 Oct 2020 14:51:14 +0000 (16:51 +0200)]
man/systemd-resolved: reword the description of query a bit
The phrase "routing domains" is used to mean both route-only domains and search
domains. Route-only domains are always called like that, and not just "route domains".
Some paragraphs are reordered to describe synthetisized records first, then
LLMNR, then various ways quries are routed.
Fixes #8928, hopefully.
(cherry picked from commit
9e1804b24c2fc75cd049b967d0f6411b6b42fecb)
Lennart Poettering [Thu, 15 Oct 2020 15:33:04 +0000 (17:33 +0200)]
util: make size macros unsigned
By making them unsigned comparing them with other sizes is less likely
to trigger compiler warnings regarding signed/unsigned comparisons.
After all sizes (i.e. size_t) are generally assumed to be unsigned, so
these should be too.
Prompted-by: https://github.com/systemd/systemd/pull/17345#issuecomment-709402332
(cherry picked from commit
67bd5620f6cf481c0a59cedbcf63ddcab355cc55)
Harald Seiler [Sun, 6 Sep 2020 19:23:36 +0000 (21:23 +0200)]
preset: don't enable proc-sys-fs-binfmt_misc.mount
The proc-sys-fs-binfmt_misc.mount unit should not be enabled by
preset-all because it should only be used as fallback in case
proc-sys-fs-binfmt_misc.automount cannot be used on a system. In these
cases it should be enabled manually by an administrator.
(cherry picked from commit
7139e9d9a3857724a857615a4bd80f857685eb97)
Felix Riemann [Mon, 19 Oct 2020 16:54:53 +0000 (18:54 +0200)]
update-done: Do not fail with read-only /etc or /var
With the switch from log_debug() to log_debug_errno() in commit
c413bb28df
systemd-update-done would fail without any error message if /etc
or /var were read-only. This restores the previous behaviour to
silently ignore these directories again.
(cherry picked from commit
1eee15c3885fcc9f6a40df7e42347cb8fca71280)
Zbigniew Jędrzejewski-Szmek [Thu, 15 Oct 2020 17:20:05 +0000 (19:20 +0200)]
logind: use notify_start/notify_on_cleanup
Logging about the pid is dropped, pid1 does that better.
(cherry picked from commit
21fe744cfb72238822a0df9e0b8f06ef95c52ade)
Zbigniew Jędrzejewski-Szmek [Thu, 15 Oct 2020 17:22:21 +0000 (19:22 +0200)]
shared/daemon-util: fix notify_on_cleanup()
p itself is never null. Because of this, we would always
call sd_notify() in cleanup, even though the intention was to only
call it if notify_start() was executed.
(cherry picked from commit
297fc20dc469694f054ed2be4358eb21efe89660)
Zbigniew Jędrzejewski-Szmek [Wed, 14 Oct 2020 10:15:58 +0000 (12:15 +0200)]
sd-bus: add custom return code when $XDG_RUNTIME_DIR is not set
We would return ENOENT, which is extremely confusing. Strace is not helpful because
no *file* is actually missing. So let's add some logs at debug level and also use
a custom return code. Let all user-facing utilities print a custom error message
in that case.
(cherry picked from commit
ab4a88eb920e2f64a79a60c1ea9aecb7907a9635)
Zbigniew Jędrzejewski-Szmek [Wed, 14 Oct 2020 09:59:23 +0000 (11:59 +0200)]
sd-bus: add debug logs where we try to connect
When connection to the bus fails it can be mighty hard to figure out
what went wrong because we have many different connection mechanisms and
we don't log what is happenning.
(cherry picked from commit
165fee860a384b2e1ea4317551bc4463b3d53b61)
Lennart Poettering [Mon, 19 Oct 2020 12:20:03 +0000 (14:20 +0200)]
bootspec: tweak error message
Clarify that the name of the entry failed validation, not the entry
itself.
(cherry picked from commit
dfc22cb4724851990d3d2ebcc2404a708e1b7223)
Lennart Poettering [Fri, 16 Oct 2020 15:20:20 +0000 (17:20 +0200)]
core: log about "systemctl kill" requests
let's add informational logging about each client requested signal
sending. While we are at, let's beef up error handling/log messages in
this case quite a bit: let's log errors both to syslog and report errors
back to client.
Fixes: #17254
(cherry picked from commit
d991100291b6d5b81176417a42c0ca6a17cf6ab8)
Lennart Poettering [Fri, 16 Oct 2020 15:16:23 +0000 (17:16 +0200)]
core: correct handling of "systemctl kill --kill-who=main-fail"
--kill-who=main-fail never worked correctly, due to a copy and paste
mistake in
ac5e3a505e49c80b56c971a8fc13bacac961640d, where the same item
was listed twice. The mistake was
later noticed, but fixed incorrectly, in
201f0c916d8f65ad2595a651b1371fcd39a4cf55.
Let's list all *-fail types correctly, finally.
And while we are at it, add a nice comment and generate a prettier D-Bus
error about this.
(cherry picked from commit
2ae0508e6dab3bb61893132fa936c1f62af8aa29)
Lennart Poettering [Fri, 16 Oct 2020 16:04:59 +0000 (18:04 +0200)]
man: document that for Type=dbus services dropping bus name has consequences
Fixes: #17150
(cherry picked from commit
bb63863304795a2454a9071ebad75ee673c145d8)
Lennart Poettering [Fri, 16 Oct 2020 16:22:37 +0000 (18:22 +0200)]
man: document that ConditionKernelCommandLine= looks at /proc/1/environ in containers
Fixes: #16941
(cherry picked from commit
af4b8f8048e2d2da0b1a1a4927339cf39c62fb8a)
Michal Koutný [Thu, 15 Oct 2020 15:56:30 +0000 (17:56 +0200)]
meson: Fix missing libseccomp dependencies
The builds with HAVE_SECCOMP fail on missing include paths:
FAILED: src/basic/libbasic.a.p/parse-util.c.o
cc -Isrc/basic/libbasic.a.p -Isrc/basic -I../src/basic -Isrc/boot -I../src/boot -Isrc/home -I../src/home -Isrc/shared -I../src/shared -Isrc/systemd -I../src/systemd -Isrc/journal -I../src/journal -Isrc/journal-remote -I../src/journal-remote -Isrc/nspawn -I../src/nspawn -Isrc/resolve -I../src/resolve -Isrc/timesync -I../src/timesync -I../src/time-wait-sync -Isrc/login -I../src/login -Isrc/udev -I../src/udev -Isrc/libudev -I../src/libudev -Isrc/core -I../src/core -Isrc/shutdown -I../src/shutdown -I../src/xdg-autostart-generator -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/libsystemd-network -I../src/libsystemd-network -I. -I.. -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -g -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Werror=shift-count-overflow -Werror=shift-overflow=2 -Wdate-time -Wnested-externs -Wno-maybe-uninitialized -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -Werror=shadow -include config.h -fPIC -pthread -fvisibility=default -MD -MQ src/basic/libbasic.a.p/parse-util.c.o -MF src/basic/libbasic.a.p/parse-util.c.o.d -o src/basic/libbasic.a.p/parse-util.c.o -c ../src/basic/parse-util.c
In file included from ../src/basic/parse-util.c:20:
../src/shared/seccomp-util.h:4:10: fatal error: seccomp.h: No such file or directory
4 | #include <seccomp.h>
| ^~~~~~~~~~~
compilation terminated.
FAILED: test-parse-util.p/src_test_test-parse-util.c.o
cc -Itest-parse-util.p -I. -I.. -Isrc/basic -I../src/basic -Isrc/boot -I../src/boot -Isrc/home -I../src/home -Isrc/shared -I../src/shared -Isrc/systemd -I../src/systemd -Isrc/journal -I../src/journal -Isrc/journal-remote -I../src/journal-remote -Isrc/nspawn -I../src/nspawn -Isrc/resolve -I../src/resolve -Isrc/timesync -I../src/timesync -I../src/time-wait-sync -Isrc/login -I../src/login -Isrc/udev -I../src/udev -Isrc/libudev -I../src/libudev -Isrc/core -I../src/core -Isrc/shutdown -I../src/shutdown -I../src/xdg-autostart-generator -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/libsystemd-network -I../src/libsystemd-network -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -g -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Werror=shift-count-overflow -Werror=shift-overflow=2 -Wdate-time -Wnested-externs -Wno-maybe-uninitialized -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -Werror=shadow -include config.h -MD -MQ test-parse-util.p/src_test_test-parse-util.c.o -MF test-parse-util.p/src_test_test-parse-util.c.o.d -o test-parse-util.p/src_test_test-parse-util.c.o -c ../src/test/test-parse-util.c
In file included from ../src/test/test-parse-util.c:14:
../src/shared/seccomp-util.h:4:10: fatal error: seccomp.h: No such file or directory
4 | #include <seccomp.h>
| ^~~~~~~~~~~
compilation terminated.
Add the respective deps.
Fixes:
005bfaf118 ("exec: Add kill action to system call filters")
(cherry picked from commit
0bc2f071e199daca9e02e0261ddf5bfd208e2c9a)
Lennart Poettering [Thu, 15 Oct 2020 13:25:56 +0000 (15:25 +0200)]
pid1: ignore whole /run/host hierarchy
Let's mark the whole /run/host hierarchy as something to ignore by PID 1
for generation of .mount units, i.e. consider it as "extrinsic".
By unifying container mgr supplied resources in one dir it's also easy
to exclude the whole lot from PID1's management inside the container.
This is the right thing to do, since from the payload's PoV these mounts
are just API and not manipulatable as they are established, managed and
owned by the container manager, not the payload.
(While we are it, also add the boot ID mount to the existing list, as
nspawn and other container managers overmount that too, typically, and
it is thus owned by the container manager and not the payload
typically.)
(cherry picked from commit
6f997852c8830ca073c55241b0068ebbf1f94a72)
Anita Zhang [Wed, 9 Sep 2020 01:35:27 +0000 (18:35 -0700)]
varlink: add server write states to disconnect check
While a server is in the VARLINK_PENDING_METHOD or VARLINK_PENDING_METHOD_MORE
states and its write end is disconnected and it gets a POLLHUP, we
should disconnect since it can't write anymore.
In the case of systemd-oomd disconnecting while pid1 was pending-more, this
condition left pid1 in a state where it started throttling from
continually getting POLLHUP.
(cherry picked from commit
e8e9227f5c3f8d47bec1d57a2801b22d53d0b341)
Lennart Poettering [Thu, 15 Oct 2020 08:54:48 +0000 (10:54 +0200)]
pager: lets check SYSTEMD_PAGERSECURE with secure_getenv()
I can't think of any real vulnerability about this, but it still feels
better to check a variable with "secure" in its name with
secure_getenv() rather than plain getenv().
Paranoia FTW!
(cherry picked from commit
b8f736b30e20a2b44e7c34bb4e43b0d97ae77e3c)
Zbigniew Jędrzejewski-Szmek [Wed, 14 Oct 2020 12:03:13 +0000 (14:03 +0200)]
sd-bus: break the loop in bus_ensure_running() if the bus is not connecting
This might fix #17025:
> the call trace is
> bus_ensure_running -> sd_bus_process -> bus_process_internal -> process_closeing --> sd_bus_close
> |
> \-> process_match
We ended doing callouts to the Disconnected matches from bus_ensure_running()
and shouldn't. bus_ensure_running() should never do callouts. This change
should fix this however: once we notice that the connection is going down we
will now fail instantly with ENOTOCONN instead of calling any callbacks.
(cherry picked from commit
93a59b1ae5d3bcb0ec1488ebc13d0d1ff4d1729a)
Lennart Poettering [Wed, 14 Oct 2020 14:35:37 +0000 (16:35 +0200)]
core: debug log about received fds
(cherry picked from commit
670eed4c8ca36505fc93ff140341ccb9c04510f4)
Lennart Poettering [Wed, 14 Oct 2020 14:21:04 +0000 (16:21 +0200)]
execute: fix single character typo
Corrects:
c413bb28df0996be99fd6b3f2335dfe8739d62fb
Fixes: #17313
(cherry picked from commit
f5fa352f1ef5a9cc05df87bc282b13a24f9d5398)
https://github.com/systemd/systemd-stable/issues/79
Lennart Poettering [Wed, 14 Oct 2020 15:08:26 +0000 (17:08 +0200)]
man: update sd_bus_message_read_array() docs to clarify return value 0 vs. 1
(cherry picked from commit
4840807c6ddd15f093eea32acc6bb93ffac67dfe)
Lennart Poettering [Wed, 14 Oct 2020 14:35:55 +0000 (16:35 +0200)]
sd-bus: initialize return values on success in sd_bus_message_read_array()
Fixes: #17346
(cherry picked from commit
6293d958a4e12269261a7b68441b1c5be71d1f02)
Zbigniew Jędrzejewski-Szmek [Wed, 7 Oct 2020 09:15:05 +0000 (11:15 +0200)]
pager: make pager secure when under euid is changed or explicitly requested
The variable is renamed to SYSTEMD_PAGERSECURE (because it's not just about
less now), and we automatically enable secure mode in certain cases, but not
otherwise.
This approach is more nuanced, but should provide a better experience for
users:
- Previusly we would set LESSSECURE=1 and trust the pager to make use of
it. But this has an effect only on less. We need to not start pagers which
are insecure when in secure mode. In particular more is like that and is a
very popular pager.
- We don't enable secure mode always, which means that those other pagers can
reasonably used.
- We do the right thing by default, but the user has ultimate control by
setting SYSTEMD_PAGERSECURE.
Fixes #5666.
v2:
- also check $PKEXEC_UID
v3:
- use 'sd_pid_get_owner_uid() != geteuid()' as the condition
(cherry picked from commit
0a42426d797406b4b01a0d9c13bb759c2629d108)
Lennart Poettering [Mon, 31 Aug 2020 17:37:13 +0000 (19:37 +0200)]
pager: set $LESSSECURE whenver we invoke a pager
Some extra safety when invoked via "sudo". With this we address a
genuine design flaw of sudo, and we shouldn't need to deal with this.
But it's still a good idea to disable this surface given how exotic it
is.
Prompted by #5666
(cherry picked from commit
612ebf6c913dd0e4197c44909cb3157f5c51a2f0)