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)
(cherry picked from commit
e99154585cd955b550c938647bd5b9650a1aedfd)
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)
(cherry picked from commit
7a301e734dfd7e0036206b09703e21e668fbd5ce)
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)
(cherry picked from commit
6a30d4e98032575d385a09d15782be74cbef6dfe)
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)
(cherry picked from commit
0752452dc504be958c38af7d49ef5b729b28de5c)
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)
(cherry picked from commit
7d250c485fe5c0974b226767b3744e0c543ae005)
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)
(cherry picked from commit
2d0e391967ac53e1b011c63304c7ade98a3797c7)
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)
(cherry picked from commit
77dddecfd0ca9200d8d241d3baf8a00cb640bd75)
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)
(cherry picked from commit
79638f63d6ddfe75f05d6936baff5de7f4253fe2)
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)
(cherry picked from commit
590b9f585c77848b6df1d254dc51bb736cfc192d)
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)
(cherry picked from commit
b92dbd67decb443cfc35b357fb6e627e4148aadf)
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)
(cherry picked from commit
52634dadb58d48527f758fe2604ca677e4fe5d3c)
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)
(cherry picked from commit
1997c2788855ab359abf7a1667164042e4936aa9)
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)
(cherry picked from commit
6cf2ec5da11488c31415f94180ad799a0187ce6c)
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)
(cherry picked from commit
9d3eb2111555a3a485db68cb331c08ab9fbeeb12)
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)
(cherry picked from commit
31c85925a9c1de385be0a0bab3574bf3e2aa3987)
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)
(cherry picked from commit
458129fa078ef0128f0cc255293139efbe032417)
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)
(cherry picked from commit
5632081ad9656ace37410d1148f5b75c28f38a89)
Matt Fenwick [Fri, 7 Aug 2020 14:43:11 +0000 (10:43 -0400)]
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)
(cherry picked from commit
42f329455667e48131c2a8d3d63f5ce2211d9a92)
Daan De Meyer [Sat, 1 Aug 2020 14:05:01 +0000 (15:05 +0100)]
nspawn: Fix incorrect usage of putenv
strv_env_get only returns the environment variable value. putenv expects
KEY=VALUE format strings. Use setenv instead to fix the use.
(cherry picked from commit
6f646e01755df587bb33dae4ca78cdaad5721f5e)
(cherry picked from commit
b81504a3c76bfb3afd339cb74988892f9dccedd1)
(cherry picked from commit
492a8b34178cf851ded4f23815d1182025bbbf8a)
Amitanand.Chikorde [Thu, 30 Jul 2020 13:18:48 +0000 (18:48 +0530)]
udev: fix codesonar warnings
Fixed below systemd codesonar warning.
isprint() is invoked here with an argument of signed
type char, but only has defined behavior for int arguments that are
either representable as unsigned char or equal to the value
of macro EOF(-1).
As per codesonar report, in a number of libc implementations, isprint()
function implemented using lookup tables (arrays): passing in a
negative value can result in a read underrun.
(cherry picked from commit
e7e954243a17cceb5278aac6249ee0dcc119b1eb)
(cherry picked from commit
1b9c95bfbf7e5fc32e033851bf06f0a9f7f9f08b)
Yu Watanabe [Fri, 31 Jan 2020 10:21:11 +0000 (19:21 +0900)]
sd-boot: fix -Wpointer-sign warning
(cherry picked from commit
efda8aebcb0e3731ba56fa11499f318a50ea4e30)
Zbigniew Jędrzejewski-Szmek [Thu, 16 Apr 2020 14:49:30 +0000 (16:49 +0200)]
network: fix static assertion on IPPROTO_MAX range
Builds with recent glibc would fail with:
../src/network/netdev/fou-tunnel.c: In function ‘config_parse_ip_protocol’:
../src/basic/macro.h:380:9: error: static assertion failed: "IPPROTO_MAX-1 <= UINT8_MAX"
380 | static_assert(expr, #expr)
| ^~~~~~~~~~~~~
../src/network/netdev/fou-tunnel.c:161:9: note: in expansion of macro ‘assert_cc’
161 | assert_cc(IPPROTO_MAX-1 <= UINT8_MAX);
| ^~~~~~~~~
This is because
f9ac84f92f151e07586c55e14ed628d493a5929d (present in
glibc-2.31.9000-9.fc33.x86_64) added IPPROTO_MPTCP=262, following
v5.5-rc5-1002-gfaf391c382 in the kernel.
(cherry picked from commit
3d58d7328a6ecbc61d3494803d705edd8a108d72)
(cherry picked from commit
c5e346905952fef0f163d91522dd43333f1f219d)
Daniel Fullmer [Thu, 23 Apr 2020 18:47:56 +0000 (14:47 -0400)]
sd-boot: fix menu ordering with boot counting
systemd-boot selects the last valid entry by default, not the first.
Fixes: #15256
(cherry picked from commit
e6190e2882e1d6772a9e586fcc65c91d406e52fb)
(cherry picked from commit
c5883bc08877d8bad10110434037a3c21950a71a)
Evgeny Vereshchagin [Fri, 22 May 2020 11:35:00 +0000 (13:35 +0200)]
tests: add a testcase for https://github.com/systemd/systemd/issues/15885
(cherry picked from commit
0d5266541cdaebf15bf0d06790f01768483587c0)
(cherry picked from commit
f6540dec4731041578bc9a8f69b62d8de298e7d9)
Susant Sahani [Fri, 22 May 2020 09:55:44 +0000 (11:55 +0200)]
network: Fix crash when SendOption= is invalid
```
p11-kit-0.23.20-1.fc32.x86_64 pam-1.3.1-26.fc33.x86_64 xz-libs-5.2.5-1.fc33.x86_64 zlib-1.2.11-21.fc32.x86_64
(gdb) bt
lvalue=0x560e10 "SendOption", ltype=2, rvalue=0x560e1b "11:string", data=0x561e20, userdata=0x561cd0) at ../src/network/networkd-dhcp-common.c:580
table=0x4392e0 <network_network_gperf_lookup>, section=0x560ef0 "DHCPv4", section_line=14, lvalue=0x560e10 "SendOption", rvalue=0x560e1b "11:string", flags=CONFIG_PARSE_WARN,
userdata=0x561cd0) at ../src/shared/conf-parser.c:132
lookup=0x7ffff7d2f76d <config_item_perf_lookup>, table=0x4392e0 <network_network_gperf_lookup>, flags=CONFIG_PARSE_WARN, section=0x7fffffffc9f8, section_line=0x7fffffffc9a0,
section_ignored=0x7fffffffc99d, l=0x560e10 "SendOption", userdata=0x561cd0) at ../src/shared/conf-parser.c:270
lookup=0x7ffff7d2f76d <config_item_perf_lookup>, table=0x4392e0 <network_network_gperf_lookup>, flags=CONFIG_PARSE_WARN, userdata=0x561cd0) at ../src/shared/conf-parser.c:395
lookup=0x7ffff7d2f76d <config_item_perf_lookup>, table=0x4392e0 <network_network_gperf_lookup>, flags=CONFIG_PARSE_WARN, userdata=0x561cd0) at ../src/shared/conf-parser.c:452
dropin_dirname=0x7fffffffcbd0 "veth99.network.d", sections=0x4f3a18 "Match", lookup=0x7ffff7d2f76d <config_item_perf_lookup>, table=0x4392e0 <network_network_gperf_lookup>,
flags=CONFIG_PARSE_WARN, userdata=0x561cd0) at ../src/shared/conf-parser.c:511
(gdb) q
A debugging session is active.
Inferior 1 [process 118718] will be killed.
```
```
$ printf '[DHCPv4]\nSendOption=1:uint8' >crash
$ ./out/fuzz-network-parser ./crash
INFO: Seed:
1158717610
INFO: Loaded 2 modules (199728 inline 8-bit counters): 136668 [0x7faf3e91a930, 0x7faf3e93bf0c), 63060 [0xadf190, 0xaee7e4),
INFO: Loaded 2 PC tables (199728 PCs): 136668 [0x7faf3e93bf10,0x7faf3eb51cd0), 63060 [0xaee7e8,0xbe4d28),
./out/fuzz-network-parser: Running 1 inputs 1 time(s) each.
Running: ./crash
Assertion 's' failed at src/basic/parse-util.c:458, function int safe_atou8(const char *, uint8_t *)(). Aborting.
==5588== ERROR: libFuzzer: deadly signal
#0 0x51811e in __sanitizer_print_stack_trace (/home/vagrant/systemd/out/fuzz-network-parser+0x51811e)
#1 0x46b921 in fuzzer::PrintStackTrace() (/home/vagrant/systemd/out/fuzz-network-parser+0x46b921)
#2 0x44ded6 in fuzzer::Fuzzer::CrashCallback() (.part.0) (/home/vagrant/systemd/out/fuzz-network-parser+0x44ded6)
#3 0x44df9d in fuzzer::Fuzzer::StaticCrashSignalCallback() (/home/vagrant/systemd/out/fuzz-network-parser+0x44df9d)
#4 0x7faf3d6d7b1f (/lib64/libpthread.so.0+0x14b1f)
#5 0x7faf3d3c2624 in raise (/lib64/libc.so.6+0x3c624)
#6 0x7faf3d3ab8d8 in abort (/lib64/libc.so.6+0x258d8)
#7 0x7faf3e12593a in log_assert_failed_realm /home/vagrant/systemd/build/../src/basic/log.c:819:9
#8 0x7faf3e140ce1 in safe_atou8 /home/vagrant/systemd/build/../src/basic/parse-util.c:458:9
#9 0x68089c in config_parse_dhcp_send_option /home/vagrant/systemd/build/../src/network/networkd-dhcp-common.c:517:21
#10 0x7faf3debed4e in next_assignment /home/vagrant/systemd/build/../src/shared/conf-parser.c:132:32
#11 0x7faf3deb7783 in parse_line /home/vagrant/systemd/build/../src/shared/conf-parser.c:270:16
#12 0x7faf3deb606c in config_parse /home/vagrant/systemd/build/../src/shared/conf-parser.c:395:21
#13 0x7faf3deb85ee in config_parse_many_files /home/vagrant/systemd/build/../src/shared/conf-parser.c:452:21
#14 0x7faf3deb8c57 in config_parse_many /home/vagrant/systemd/build/../src/shared/conf-parser.c:511:16
#15 0x57c2eb in network_load_one /home/vagrant/systemd/build/../src/network/networkd-network.c:470:13
#16 0x543490 in LLVMFuzzerTestOneInput /home/vagrant/systemd/build/../src/network/fuzz-network-parser.c:26:16
#17 0x44e3e8 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/home/vagrant/systemd/out/fuzz-network-parser+0x44e3e8)
#18 0x433505 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) (/home/vagrant/systemd/out/fuzz-network-parser+0x433505)
#19 0x43c449 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/home/vagrant/systemd/out/fuzz-network-parser+0x43c449)
#20 0x42c4a6 in main (/home/vagrant/systemd/out/fuzz-network-parser+0x42c4a6)
#21 0x7faf3d3ad1a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)
#22 0x42c4fd in _start (/home/vagrant/systemd/out/fuzz-network-parser+0x42c4fd)
NOTE: libFuzzer has rudimentary signal handlers.
Combine libFuzzer with AddressSanitizer or similar for better crash reports.
SUMMARY: libFuzzer: deadly signal
```
(cherry picked from commit
1eb73422f29bccf0ec68eda4fd9e8d8795cc5d80)
(cherry picked from commit
2a41fb267dd7f0dda0fda81a476f3d03aa1c4cb6)
Zbigniew Jędrzejewski-Szmek [Wed, 26 Feb 2020 22:34:41 +0000 (23:34 +0100)]
kernel-install: strip BOOT_IMAGE= from kernel options
https://bugzilla.redhat.com/show_bug.cgi?id=
1716164.
(cherry picked from commit
e60228bf68427c0c0f96f816ee9124fd39585038)
Zbigniew Jędrzejewski-Szmek [Sun, 31 May 2020 16:21:09 +0000 (18:21 +0200)]
basic/user-util: always use base 10 for user/group numbers
We would parse numbers with base prefixes as user identifiers. For example,
"0x2b3bfa0" would be interpreted as UID==
45334432 and "01750" would be
interpreted as UID==1000. This parsing was used also in cases where either a
user/group name or number may be specified. This means that names like
0x2b3bfa0 would be ambiguous: they are a valid user name according to our
documented relaxed rules, but they would also be parsed as numeric uids.
This behaviour is definitely not expected by users, since tools generally only
accept decimal numbers (e.g. id, getent passwd), while other tools only accept
user names and thus will interpret such strings as user names without even
attempting to convert them to numbers (su, ssh). So let's follow suit and only
accept numbers in decimal notation. Effectively this means that we will reject
such strings as a username/uid/groupname/gid where strict mode is used, and try
to look up a user/group with such a name in relaxed mode.
Since the function changed is fairly low-level and fairly widely used, this
affects multiple tools: loginctl show-user/enable-linger/disable-linger foo',
the third argument in sysusers.d, fourth and fifth arguments in tmpfiles.d,
etc.
Fixes #15985.
(cherry picked from commit
156a5fd297b61bce31630d7a52c15614bf784843)
(cherry picked from commit
9498903de6c1f7b0c3e5f1654d0ee451a304c59d)
Yu Watanabe [Tue, 23 Jun 2020 07:10:25 +0000 (09:10 +0200)]
parse-util: backport safe_atou32_full()
We need this for a follow up security fix.
(cherry picked from commit
b934ac3d6e7dcad114776ef30ee9098693e7ab7e)
(cherry picked from commit
64126925181809e7c0b8916471186c0bfa19d6ce)
Zbigniew Jędrzejewski-Szmek [Tue, 30 Jun 2020 07:56:10 +0000 (09:56 +0200)]
Fix build with µhttpd 0.9.71
The return type of callbacks was changed from int to an enum.
(cherry picked from commit
d17eabb1052e7c8c432331a7a782845e36164f01)
(cherry picked from commit
a91ed646aa698ff530770c836c174fb7b3a5e799)
Romain Naour [Mon, 2 Mar 2020 05:48:21 +0000 (06:48 +0100)]
random-seed: add missing header for GRND_NONBLOCK (#14988)
GRND_NONBLOCK has been introduced with the 3.17 kernel version [1]
while adding getrandom(2) system call.
The header missing_random.h is needed for random-seed.c when building
with old toolchain, such Sourcery CodeBench ARM 2014.05 (kernel headers
3.13).
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/
454255917
[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=
c6e9d6f38894798696f23c8084ca7edbf16ee895
(cherry picked from commit
123aeae20672f251fa0305a99ee8ccd6c97850ad)
Oliver Giles [Thu, 13 Feb 2020 06:55:57 +0000 (08:55 +0200)]
makefs: strdup arguments to mkfs
Don't pass values from argv[] directly to child process forked using
safe_fork, because it clears argv[]. strdup them first.
(cherry picked from commit
c315b79fb43a4d921a533ba0c2cb303324887993)
Yu Watanabe [Thu, 12 Dec 2019 10:01:21 +0000 (19:01 +0900)]
network-generator: allow empty hostname
Fixes #14319.
(cherry picked from commit
21a925a4ac7955e7d7e6cfd477e96d3a2aaee7db)
Susant Sahani [Sat, 21 Mar 2020 17:32:51 +0000 (18:32 +0100)]
network: DHCP lease load SIP copy paste error
(cherry picked from commit
be1af905852d25e11fdf0cb4f37be2a58567dd94)
(cherry picked from commit
0f5047b7d393cfba37f91e25cae559a0bc910582)
pelzvieh [Mon, 23 Mar 2020 10:15:11 +0000 (11:15 +0100)]
davfs is a network file system
(cherry picked from commit
137d4487511b3221d3c9165326bf55f297dcd5a6)
(cherry picked from commit
98a349465291801537b644ff1478ac2daeeeba21)
Franck Bui [Tue, 17 Mar 2020 17:30:58 +0000 (18:30 +0100)]
logind: log a more accurate error when we failed at session creation
We used to log the following error:
"Start job for unit user-1000.slice failed with 'canceled'"
which can be really misleading if the actual job failed at *stopping* a unit.
Indeed "Start" was hard coded but it was wrong since we can also fail with stop
jobs which are enqueued when a session is stopped.
(cherry picked from commit
b39648ed47065202b343d1d4bde3232d81fdfecc)
(cherry picked from commit
8f0feac20f7d4c29a42839343308fcd602ec5b63)
Joerg Behrmann [Tue, 10 Mar 2020 15:34:13 +0000 (16:34 +0100)]
docs: Add syntax for templated units to systemd.preset man page
This documents the syntax
enable template@.service foo bar baz
that was introduced in #9901 to preset templated units.
(cherry picked from commit
1f667d8a7cff4355cd23ebebeb4d7179e3498eb8)
(cherry picked from commit
d1d3f2aa1561a9a75ce58026ef0a6bd4c5b464ac)
Zbigniew Jędrzejewski-Szmek [Wed, 11 Mar 2020 08:10:22 +0000 (09:10 +0100)]
man: add a tiny bit of markup
(cherry picked from commit
0b1b0a01ab22c088046634c46c496022e7e60673)
(cherry picked from commit
3c69813c69af90e75acf9a80047ecf5b075c138d)
Frantisek Sumsal [Sat, 14 Mar 2020 09:36:17 +0000 (10:36 +0100)]
test: wait a bit after starting the test service
otherwise we might end up being faster than the unit itself, causing
unexpected fails, like:
```
testsuite.sh[297]: + systemctl start issue_14566_test
testsuite.sh[297]: + systemctl status issue_14566_test
testsuite.sh[304]: ● issue_14566_test.service - Issue 14566 Repro
testsuite.sh[304]: Loaded: loaded (/etc/systemd/system/issue_14566_test.service; static; vendor preset: enabled)
testsuite.sh[304]: Active: active (running) since Sat 2020-03-14 02:02:23 UTC; 417ms ago
testsuite.sh[304]: Main PID: 301 ((repro.sh))
testsuite.sh[304]: Tasks: 1 (limit: 535)
testsuite.sh[304]: Memory: 180.0K
testsuite.sh[304]: CPU: 122ms
testsuite.sh[304]: CGroup: /system.slice/issue_14566_test.service
testsuite.sh[304]: └─301 [(repro.sh)]
testsuite.sh[307]: ++ cat /leakedtestpid
testsuite.sh[307]: cat: /leakedtestpid: No such file or directory
testsuite.sh[297]: + leaked_pid=
```
(cherry picked from commit
197298ff9fc930de450330095cc5b67d165d0801)
(cherry picked from commit
e110f4dacb6d56fc9d99456422c2cff7e54ae7f0)
Georg Müller [Thu, 12 Mar 2020 19:02:21 +0000 (20:02 +0100)]
fix journalctl regression (#15099)
This regression was introduced in #14913.
The current_file variable can be NULL, as, for example, with the
following commands:
* journalctl --list-boots
* journalctl -b -1 --no-pager
Since current_file is only checked for pointer equality with f, removing
the assertion is safe here.
(cherry picked from commit
8d0726fcd7b72f2a6f75dd731cbf7c8d4df107ef)
(cherry picked from commit
e8df08cfdb20e31066559c53420d7fd56b31ec01)
Anita Zhang [Sat, 25 Jan 2020 15:46:16 +0000 (16:46 +0100)]
core: transition to FINAL_SIGTERM state after ExecStopPost=
Fixes #14566
(cherry picked from commit
c1566ef0d22ed786b9ecf4c476e53b8a91e67578)
(cherry picked from commit
b7f2308bda4942d1b8e10250db6836fe4fc0d8b8)
Georg Müller [Thu, 20 Feb 2020 18:19:41 +0000 (19:19 +0100)]
journalctl: show duplicate entries if they are from the same file (#14898)
When having a service which intentionally outputs multiple equal lines,
all these messages might be inserted with the same timestamp.
journalctl has a mechanism to avoid duplicate lines, which might be in
different journal files.
This patch allows duplicate lines, if they are from the same file.
(cherry picked from commit
b6849042d610da90d5821a03967d648d424f7864)
(cherry picked from commit
2867dfbf70a5d761f662fe4b7c81a67e19df008b)
Valery0xff [Wed, 11 Mar 2020 00:20:36 +0000 (02:20 +0200)]
udev: fix SECLABEL{selinux} issue (#15064)
Add SECLABEL{selinux}="some value" cause udevadm crash
systemd-udevd[x]: Worker [x] terminated by signal 11 (SEGV)
It happens since
25de7aa7b90 (Yu Watanabe 2019-04-25 01:21:11 +0200)
when udev rules processing changed to token model. Yu forgot store
attr to SECLABEL token so fix it.
(cherry picked from commit
0335d110afc08baf47d76b7011ce02510dfdd524)
(cherry picked from commit
d58988be7fab2bf3e037ccf175f3cace41f82b80)
Topi Miettinen [Mon, 9 Mar 2020 12:01:06 +0000 (14:01 +0200)]
dissect-image: avoid scanning partitions
In case the dissected image has a filesystem, don't scan for partitions. This
avoids problems with services using a `RootImage=` in early boot when udevd is
not yet started.
(cherry picked from commit
0108c42f59dd5848f6b561f260dc6ff3e19d651b)
(cherry picked from commit
98f8a718c161d45b0001ee68f2ec7d111da79397)
Frantisek Sumsal [Mon, 9 Mar 2020 10:00:58 +0000 (11:00 +0100)]
test: ignore IAB capabilities in `test-execute`
libcap v2.33 introduces a new capability set called IAB[0] which is shown
in the output of `capsh --print` and interferes with the test checks. Let's
drop the IAB set from the output, for now, to mitigate this.
This could be (and probably should be) replaced in the future by the
newly introduced testing options[1][2] in libcap v2.32, namely:
--has-p=xxx
--has-i=xxx
--has-a=xxx
but this needs to wait until the respective libcap version gets a wider
adoption. Until then, let's stick with the relatively ugly sed.
Fixes: #15046
[0] https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=
943b011b5e53624eb9cab4e96c1985326e077cdd
[1] https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=
588d0439cb6495b03f0ab9f213f0b6b339e7d4b7
[2] https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=
e7709bbc1c4712f2ddfc6e6f42892928a8a03782
(cherry picked from commit
e9cdcbed77971da3cb0b98b3eb91081142c91eb7)
(cherry picked from commit
35c4d42040ec4539cbb2fd2391dea21abcf51a35)
Denis Pronin [Sun, 8 Mar 2020 20:57:07 +0000 (23:57 +0300)]
Support compiling with clang and gnu11 standard
Signed-off-by: Denis Pronin <dannftk@yandex.ru>
(cherry picked from commit
36e0d89a88c51ba879a2d7e2f90ea9b38333e2c0)
(cherry picked from commit
9251cac7b2969691fbf50d77e8c61052c1f7e4d5)
bemarek [Sun, 8 Mar 2020 21:39:01 +0000 (22:39 +0100)]
James T. Lee [Sat, 7 Mar 2020 23:05:34 +0000 (18:05 -0500)]
boot: Ensure ARM UEFI binary does not contain FP/SIMD instructions
ARM toolchains will sometimes optimize otherwise floating-point-free
code with floating point and SIMD instructions. This was happening with
systemd-bootarm.efi and it was causing U-Boot to crash and reset the
CPU. U-Boot does not support the ARM VFP floating point coprocessor,
which is an optional piece of hardware anyway [1].
Ensure the compiler does not generate FP/SIMD instructions by supplying
the `-mgeneral-regs-only` option when building for ARM [2].
The other option you often see to solve these problems is
`-msoft-float`, but that changes the ABI and prevents linking with
libgnuefi.
[1] https://lists.denx.de/pipermail/u-boot/2011-February/087736.html
[2] https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html#index-mgeneral-regs-only-1
(cherry picked from commit
1ad6056239b70ce69ea70108cf4e49a05a9c2a1d)
(cherry picked from commit
73678d2307042a45ceb3d7fe2fd182f6f6ec3f2d)
Zbigniew Jędrzejewski-Szmek [Fri, 7 Feb 2020 15:50:52 +0000 (16:50 +0100)]
Revert "Support Plugable UD-PRO8 dock"
This reverts commit
98c03090274a067806090e2974fd2091f8206457.
See https://github.com/systemd/systemd/issues/14822.
Zbigniew Jędrzejewski-Szmek [Tue, 3 Dec 2019 16:04:26 +0000 (17:04 +0100)]
hibernate-resume-generator: wait "infinitely" for the resume device
This makes changes similar to the parent commit, but for hibernate-resume-generator.
If resume= is specified on the kernel command line, we'll set JobRunningTimeoutSec=0
for the device. This matches what we do for the root device.
In practice, other timeouts will take effect. For example dracut tries (and
fails :[ ) to start dracut-emergency.service after some time.
Fixes #7242, https://bugzilla.redhat.com/show_bug.cgi?id=
1705522.
(cherry picked from commit
ff757c9d294153a26a9dd2d9817d1985656f3002)
Zbigniew Jędrzejewski-Szmek [Wed, 5 Feb 2020 16:54:16 +0000 (17:54 +0100)]
hwdb: update to v245-rc1
The change in
419a8a2dabb4184080d06f583f9539780ec10ec6 is not included.
Zbigniew Jędrzejewski-Szmek [Tue, 4 Feb 2020 17:39:04 +0000 (18:39 +0100)]
Fix typo in function name
(cherry picked from commit
bc130b6858327b382b07b3985cf48e2aa9016b2d)
Lennart Poettering [Wed, 22 Jan 2020 16:07:47 +0000 (17:07 +0100)]
polkit: when authorizing via PK let's re-resolve callback/userdata instead of caching it
Previously, when doing an async PK query we'd store the original
callback/userdata pair and call it again after the PK request is
complete. This is problematic, since PK queries might be slow and in the
meantime the userdata might be released and re-acquired. Let's avoid
this by always traversing through the message handlers so that we always
re-resolve the callback and userdata pair and thus can be sure it's
up-to-date and properly valid.
(cherry picked from commit
637486261528e8aa3da9f26a4487dc254f4b7abb)
Lennart Poettering [Wed, 22 Jan 2020 16:05:17 +0000 (17:05 +0100)]
sd-bus: introduce API for re-enqueuing incoming messages
When authorizing via PolicyKit we want to process incoming method calls
twice: once to process and figure out that we need PK authentication,
and a second time after we aquired PK authentication to actually execute
the operation. With this new call sd_bus_enqueue_for_read() we have a
way to put an incoming message back into the read queue for this
purpose.
This might have other uses too, for example debugging.
(cherry picked from commit
1068447e6954dc6ce52f099ed174c442cb89ed54)
zjs: patch modified to not make the function public
Lennart Poettering [Wed, 22 Jan 2020 15:53:59 +0000 (16:53 +0100)]
polkit: use structured initialization
(cherry picked from commit
f4425c72c7395ec93ae00052916a66e2f60f200b)
Lennart Poettering [Wed, 22 Jan 2020 15:52:10 +0000 (16:52 +0100)]
polkit: on async pk requests, re-validate action/details
When we do an async pk request, let's store which action/details we used
for the original request, and when we are called for the second time,
let's compare. If the action/details changed, let's not allow the access
to go through.
(cherry picked from commit
7f56982289275ce84e20f0554475864953e6aaab)
Lennart Poettering [Wed, 22 Jan 2020 15:44:43 +0000 (16:44 +0100)]
polkit: reuse some common bus message appending code
(cherry picked from commit
95f82ae9d774f3508ce89dcbdd0714ef7385df59)
Lennart Poettering [Wed, 22 Jan 2020 13:29:43 +0000 (14:29 +0100)]
bus-polkit: rename return error parameter to ret_error
(cherry picked from commit
773b1a7916bfce3aa2a21ecf534d475032e8528e)
Lennart Poettering [Wed, 22 Jan 2020 10:39:22 +0000 (11:39 +0100)]
shared: split out polkit stuff from bus-util.c → bus-polkit.c
It's enough, complex stuff to warrant its own source file.
No other changes, just splitting out.
(cherry picked from commit
269e4d2d6b75329ae39a71ebe2c14500e03cda95)
Frantisek Sumsal [Tue, 4 Feb 2020 12:49:01 +0000 (13:49 +0100)]
test: adapt to the new capsh format
Since libcap v2.29 the format of cap_to_text() has been changed which
makes certain `test-execute` subtest fail. Let's remove the offending
part of the output (dropped capabilities) to make it compatible with
both the old and the new libcap.
(cherry picked from commit
9569e385036c05c0bf9fbccdbf3d131161398e2e)
Zbigniew Jędrzejewski-Szmek [Mon, 3 Feb 2020 19:38:54 +0000 (20:38 +0100)]
meson: update efi path detection to gnu-efi-3.0.11
Fixes systemd build in Fedora rawhide.
The old ldsdir option is not useful, because both the directory and the
file name changed. Let's remove the option and try to autodetect the file
name. If this turns out to be not enough, a new option to simply specify
the full path to the file can be added.
F31:
efi arch: x86_64
EFI machine type: x64
EFI CC ccache cc
EFI lds: /usr/lib64/gnuefi/elf_x64_efi.lds
EFI crt0: /usr/lib64/gnuefi/crt0-efi-x64.o
EFI include directory: /usr/include/efi
F32:
efi arch: x86_64
EFI machine type: x64
EFI CC ccache cc
EFI lds: /usr/lib/gnuefi/x64/efi.lds
EFI crt0: /usr/lib/gnuefi/x64/crt0.o
EFI include directory: /usr/include/efi
(cherry picked from commit
ce4121c6ff92c1c368874bd451b73fa9b1ddec4a)
Zbigniew Jędrzejewski-Szmek [Mon, 3 Feb 2020 14:45:07 +0000 (15:45 +0100)]
presets: "disable" all passive targets by default
Officially we default to a "enable *", even though pretty much everybody
overrides this with "disable *". We have a bunch of targets and services which
should not be enabled by default. In case the default policy is not overriden,
our passive units would be enabled by presets, which is generally not useful at
all. So let's explicitly mark them as disabled.
Note that this effectively changes very little. E.g. on Fedora, all the units
listed in this patch were "disabled" already.
Fixes #14648.
(cherry picked from commit
61c3e2c8bfc28cea5b52d8643fac3d85f4c571d2)
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jan 2020 14:53:57 +0000 (15:53 +0100)]
shared/sysctl-util: normalize repeated slashes or dots to a single value
We use those strings as hash keys. While writing "a...b" looks strange,
"a///b" does not look so strange. Both syntaxes would actually result in the
value being correctly written to the file, but they would confuse our
de-deplication over keys. So let's normalize. Output also becomes nicer.
Add test.
(cherry picked from commit
f3b136a4847a0993e2dc1197779160dca4da6dac)
Yu Watanabe [Thu, 30 Jan 2020 11:18:35 +0000 (20:18 +0900)]
dhcp6: do not use T1 and T2 longer than one provided by the lease
Fixes #12623.
(cherry picked from commit
9de8a4259eaebf4635142474e016b90ce5be5181)
Yu Watanabe [Wed, 29 Jan 2020 11:39:12 +0000 (20:39 +0900)]
network: fix implicit type conversion warning by GCC-10
Fixes part of #14691.
(cherry picked from commit
a44956c94a93fe34b5398ed9aefcf0fc705d4fa6)
Yu Watanabe [Sun, 26 Jan 2020 04:05:13 +0000 (13:05 +0900)]
bootspec: parse random-seed-mode line in loader.conf
Fixes #14657.
(cherry picked from commit
fe5a698f7646735335a97cc429ebe5d79f67fb70)
Yu Watanabe [Sun, 26 Jan 2020 03:59:48 +0000 (12:59 +0900)]
sd-boot: fix typo
Fixes #14657.
(cherry picked from commit
a14c18ba7b4e85f34bd48c5a778ea5eafe5c8688)
dann frazier [Tue, 28 Jan 2020 01:45:17 +0000 (18:45 -0700)]
test: Synchronize journal before reading from it
There's a race condition in the sysuser test where it may try to read
entries from the journal before they are available. Fix it by adding a
`journalctl --sync` call.
BugLink: https://bugs.launchpad.net/bugs/1776654
(cherry picked from commit
37b9966e2525790843ab302a5b8009853a7905a0)
sangelovic [Mon, 27 Jan 2020 20:40:37 +0000 (21:40 +0100)]
sd-bus: fix introspection bug in signal parameter names
(cherry picked from commit
58abbbcc6bcedc4eebd1f5c7733cd41518e1f2e3)
Susant Sahani [Sat, 25 Jan 2020 10:30:08 +0000 (11:30 +0100)]
efi: fix build.
```
ninja -C build
ninja: Entering directory `build'
[29/101] Generating systemd_boot.so with a custom command.
FAILED: src/boot/efi/systemd_boot.so
/usr/bin/ld -o src/boot/efi/systemd_boot.so -T /usr/lib64/gnuefi/elf_x64_efi.lds -shared -Bsymbolic -nostdlib -znocombreloc -L /usr/lib64 /usr/lib64/gnuefi/crt0-efi-x64.o src/boot/efi/disk.c.o src/boot/efi/graphics.c.o src/boot/efi/measure.c.o src/boot/efi/pe.c.o src/boot/efi/util.c.o src/boot/efi/boot.c.o src/boot/efi/console.c.o src/boot/efi/crc32.c.o src/boot/efi/random-seed.c.o src/boot/efi/sha256.c.o src/boot/efi/shim.c.o -lefi -lgnuefi /usr/lib/gcc/x86_64-redhat-linux/10/libgcc.a
/usr/bin/ld: src/boot/efi/graphics.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/pe.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/util.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/boot.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/console.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/random-seed.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
/usr/bin/ld: src/boot/efi/shim.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: multiple definition of `loader_guid'; src/boot/efi/disk.c.o:/home/sus/tt/systemd/build/../src/boot/efi/util.h:58: first defined here
[31/101] Generating stub.c.o with a custom command.
ninja: build stopped: subcommand failed.
make: *** [Makefile:2: all] Error 1
```
(cherry picked from commit
8bdda551dab5579a14db1d66f34356d45d5cda16)
Lennart Poettering [Tue, 21 Jan 2020 09:40:18 +0000 (10:40 +0100)]
generator: order growfs for the root fs after systemd-remount-fs
Fixes: #14603
(cherry picked from commit
18e6e8635f06ac8d935ed5494ea65c6dac6af90f)
Lennart Poettering [Tue, 21 Jan 2020 12:43:04 +0000 (13:43 +0100)]
loginctl: use /org/freedesktop/login1/session/auto when "lock-session" is called without argument
This way we'll use the "display" session automatically, and that makes
the call work when invoked from user@.service.
Fixes: #13614
(cherry picked from commit
dc084399fad28cc98e7bcdb9074141c97e863bee)
Antonio Russo [Tue, 21 Jan 2020 02:35:13 +0000 (19:35 -0700)]
Documentation update for x-systemd.{before,after}
A minor clarification in the manual page is made.
Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
(cherry picked from commit
81248e7f3e83a24cbbc8d2a09a01abf55e81bcda)
Andreas Rammhold [Tue, 21 Jan 2020 17:22:22 +0000 (18:22 +0100)]
man: fix typo in systemd.netdev Xfrm example
The first section header in that example should probably be `[NetDev]` and not `[Xfrm]`.
(cherry picked from commit
a15e1a5df0c943ec5414014e54719bd1259fd00a)
Lennart Poettering [Tue, 21 Jan 2020 11:03:02 +0000 (12:03 +0100)]
timesyncd: log louder when we refuse a server due to root distance
This is something people should know about, since it's caused by
misconfiguration.
Fixes: #13912
(cherry picked from commit
ce96c9cb1a8f81ff4bbc40f5a98d003d6ffacb57)
Lennart Poettering [Mon, 20 Jan 2020 16:11:31 +0000 (17:11 +0100)]
resolved: drop DNSSEC root key that is not valid anymore
I guess we can drop this now, the key is no longer valid until
2019-01-11, hence there's no point in still including it in our trust
anchor.
(cherry picked from commit
f1f20764f9e52d6825867b2852206ed6cfcabbb9)
Lennart Poettering [Tue, 21 Jan 2020 09:49:58 +0000 (10:49 +0100)]
journal: don't use startswith() on something that is not a NUL-terminated string
Otherwise we might access memory coming after it that is not valid or
allocated.
Fixes: #14114
(cherry picked from commit
e0567bc8adfe027052b78b40efb57d543924f138)
Lennart Poettering [Mon, 20 Jan 2020 13:40:44 +0000 (14:40 +0100)]
test: add test for https://github.com/systemd/systemd/issues/14560
(cherry picked from commit
e56a8790a0bf9021d693daef037cd6af85badf0d)
Lennart Poettering [Fri, 17 Jan 2020 11:41:53 +0000 (12:41 +0100)]
core: make sure StandardInput=file: doesn't get dup'ed to stdout/stderr by default
Fixes: #14560
(cherry picked from commit
3b7f79dc9fc5557074ebe4a3b060e8dcf8cdcc0f)
Sascha Dewald [Sat, 18 Jan 2020 08:17:57 +0000 (08:17 +0000)]
pkgconf: add full generator paths
(cherry picked from commit
fc57f105d9e2b2e9e95bb739d23fa7711b5fa4b3)
Lennart Poettering [Fri, 17 Jan 2020 14:37:56 +0000 (15:37 +0100)]
tree-wide: we forgot to destroy some bus errors
(cherry picked from commit
7e284b054ec599012f0dad6a745f6b52eba87853)
Lennart Poettering [Fri, 17 Jan 2020 14:09:01 +0000 (15:09 +0100)]
mount: make checks on perpetual mount units more lax
We don#t really care where perpetual mounts are mounted from, since they
have to exist since before we run anyway.
(cherry picked from commit
0879fbd6fedc2f813aebcb1a4eba005a99525bde)
Lennart Poettering [Fri, 17 Jan 2020 14:02:13 +0000 (15:02 +0100)]
core: never allow perpetual units to be masked
Fixes: #14550
(cherry picked from commit
88414eed6f45f738ae765d9f72d67c6dc5a51950)
Wieland Hoffmann [Sat, 18 Jan 2020 07:38:29 +0000 (08:38 +0100)]
typo: "May modify to" -> "May modify"
(cherry picked from commit
287cf2d802263c909553689869b2146c67bb765f)
Arian van Putten [Wed, 15 Jan 2020 16:10:11 +0000 (17:10 +0100)]
Disable reading SystemdOptions EFI Var when in SecureBoot mode
In SecureBoot mode this is probably not what you want. As your cmdline
is cryptographically signed like when using Type #2 EFI Unified Kernel
Images (https://systemd.io/BOOT_LOADER_SPECIFICATION/) The user's
intention is then that the cmdline should not be modified. You want to
make sure that the system starts up as exactly specified in the signed
artifact.
(cherry picked from commit
c7d26acce6dcb0e72be6160873fac758e9b7c440)
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jan 2020 13:45:28 +0000 (14:45 +0100)]
sysctl: downgrade message when we have no permission
We need to run sysctl also in containers, because the network
subtree is namespaces and may legitimately be writable. But logging
all "errors" at notice level creates unwanted noise.
Also downgrade message about missing sysctls to log_info. This might also be
relatively common when configuration is targeted at different kernel
versions. With log_debug it'll still end up in the logs, but isn't really worth
of "notice" most of the time.
https://bugzilla.redhat.com/show_bug.cgi?id=
1609806
(cherry picked from commit
32458cc9687c1b60ff0f22c0e71da93ce78b1534)
Luca Boccassi [Thu, 16 Jan 2020 16:24:07 +0000 (16:24 +0000)]
Clarify journald.conf MaxLevelStore documentation
'stored on disk' gives the impression that this option affects only
permanent storage, even though it affects everything the journal
records, regardless of the storage type.
Use 'stored in the journal' to avoid confusion.
(cherry picked from commit
c97ae2b29036af29480ee506a072525917f5d41f)
Lennart Poettering [Mon, 6 Jan 2020 19:13:16 +0000 (20:13 +0100)]
logind: refuse overriding idle hint on tty sessions
Previously we'd allow marking TTY sessions as idle, but when the user
tried to unmark it as idle again it we'd just revert to automatic TTY
atime idle detection, thus making it impossible to mark the session as
non-idle, unless its TTY is atime-touched all the time. But of course,
marking a session as idle is pretty much fatal if you never can mark it
as non-idle again.
This change is triggred by bug reports such as this:
https://github.com/systemd/systemd/issues/14053
With this patch we will now output a clean, clear error message if a
client tries to manipulate the idle state of a non-graphical session.
This means we now have clear rules: "manual" idle logic for graphical
sessions, and TTY based ones for all others that have a TTY of some
form.
I considered allowing the idle state to be overriden both ways for tty
sessions but that's problematic: for sessions that are temporarily
upgraded from tty to graphical and thus suddenly want to manage their
own idle state we'd need to a way to detect when the upgrade goes away
and thus we should revert to old behaviour. Without reverting to the
previous TTY idle auto-magic we'd otherwise be stuck in an eternally
idle or eternally non-idle state, with really bad effects in case
auto-suspend is used. Thus, let's instead generate a proper error
message, saying clearly we don't support it.
(Also includes some other fixes and clean-ups in related code)
Closes: #14053
(cherry picked from commit
be2bb14f00441d9e4a26f94834518db3829e83ed)
Lennart Poettering [Mon, 13 Jan 2020 19:06:39 +0000 (20:06 +0100)]
cgroup: update only siblings that got realized once
Fixes: #14475
Replaces: #14554
(cherry picked from commit
e1e98911a818ad3b46c6a1c26d759df590bef476)
Jun'ichi Nomura [Tue, 3 Dec 2019 07:52:02 +0000 (16:52 +0900)]
mount: mark an existing "mounting" unit from /proc/self/mountinfo as "just_mounted"
When starting a mount unit, systemd invokes mount command and moves the
unit's internal state to "mounting". Then it watches for updates of
/proc/self/mountinfo. When the expected mount entry newly appears in
mountinfo, the unit internal state is changed to "mounting-done".
Finally, when systemd finds the mount command has finished, it checks
whether the unit internal state is "mounting-done" and changes the state
to "mounted".
If the state was not "mounting-done" in the last step though mount command
was successfully finished, the unit is marked as "failed" with following
log messages:
Mount process finished, but there is no mount.
Failed with result 'protocol'.
If daemon-reload is done in parallel with starting mount unit, it is
possible that things happen in following order and result in above failure.
1. the mount unit state changes to "mounting"
2. daemon-reload saves the unit state
3. kernel completes the mount and /proc/self/mountinfo is updated
4. daemon-reload restores the saved unit state, that is "mounting"
5. systemd notices the mount command has finished but the unit state
is still "mounting" though it should be "mounting-done"
mount_setup_existing_unit() should take into account that MOUNT_MOUNTING
is transitional state and set MOUNT_PROC_JUST_MOUNTED flag if the unit
comes from /proc/self/mountinfo so that mount_process_proc_self_mountinfo()
later can make state transition from "mounting" to "mounting-done".
Fixes: #10872
(cherry picked from commit
1d086a6e59729635396204fc05234f1d3caa0847)
Timo Schlüßler [Mon, 13 Jan 2020 09:26:58 +0000 (09:26 +0000)]
journalctl: Correctly handle combination of --reverse and --lines (fixes #1596)
(cherry picked from commit
23b392166388003530fef02ac5758c91315a707b)
Timo Schlüßler [Mon, 13 Jan 2020 09:09:45 +0000 (09:09 +0000)]
journalctl: Correctly handle --show-cursor in combination with --until or --since and --reverse
(cherry picked from commit
3ac9cac7f7a34c3713b49841ee75ef9c9357e7e4)
Lennart Poettering [Thu, 9 Jan 2020 16:30:31 +0000 (17:30 +0100)]
core: fix re-realization of cgroup siblings
This is a fix-up for
eef85c4a3f8054d29383a176f6cebd1ef3a15b9a which
broke this.
Tracked down by @w-simon
Fixes: #14453
(cherry picked from commit
65f6b6bdcb500c576674b5838e4cc4c35e18bfde)
Lennart Poettering [Thu, 9 Jan 2020 10:51:40 +0000 (11:51 +0100)]
core: propagate service state to socket in more load states
It makes sense to filter state changes for some load states that
shouldn't happen, but the common cases should be accepted, because they
might happen during runtime when "systemctl daemon-reload" is issued and
unit files changed state in between. Otherwise we lose events.
Fixes: #4708
(cherry picked from commit
4c2ef3276735ad9f7fccf33f5bdcbe7d8751e7ec)
HATAYAMA Daisuke [Wed, 18 Dec 2019 03:01:42 +0000 (22:01 -0500)]
man: describe "symlink" and "systemctl link" explicitly in UNIT FILE LOAD PATH
There are sometimes users who put unit files in a location that is inaccessible
when systemd starts although they are not found and thus not started because
the corresponding mount units have not activated yet.
There is already a warning for such issue in man 8 systemctl:
link PATH...
...<snip>...
The file system where
the linked unit files are located must be accessible
when systemd is started (e.g. anything underneath /home
or /var is not allowed, unless those directories are
located on the root file system).
However, it looks that it's difficult to find the warning because introductory
users typically doesn't know systemctl link.
Although there is a description in UNIT FILE LOAD PATH pointing to systemctl
link, symlink is now not explicitly mentioned there and thus users doesn't
easily get aware of they should read it.
To deal with this, let's describe "symlink" and "systemctl link" more
explicitly in UNIT FILE LOAD PATH.
(cherry picked from commit
b63c88b6271804e4770a14d94c66210e0c8063d7)
Lennart Poettering [Thu, 9 Jan 2020 11:01:45 +0000 (12:01 +0100)]
core: be more restrictive on the dependency types we allow to be created transiently
We should allow the ones that the [Unit] section of regular unit files
may accet, but no other, in particular not the internal deps we
synthesize as reverse of explicitly configured ones, such was WantedBy=.
Fixes: #14251
(cherry picked from commit
404308486aa285c67c5af4c8e7d6be393ce5a3c7)
Thomas Schmitt [Mon, 6 Jan 2020 07:10:32 +0000 (15:10 +0800)]
udev: don't import parent ID_FS_ data on partitions
When probing partitions, we inherit important information from the parent
disk device such as ID_MODEL, and usage of such properties is seen to
be acceptable and well established.
However, we need to exclude filesystem information from the properties
that get inherited. Information about the device content should not be
passed on in this way.
For example, Linux distro install media commonly uses an ISO filesystem
plus a partition table. The ISO filesystem is detected on the main disk
device, but we should not pass down those details to the partitions,
some or all of which may be pointing at storage areas completely distinct
from the ISO filesystem.
This is particularly problematic when adding new partitions on media
set up in this way (since the new partitions are then reported to contain
the parent device's ISO filesystem), or when dealing with more unusual
hybrid ISO layouts. The inaccuracy of information here inversely affects
users of blkid and udev's persistent storage symlinks.
Exclude ID_FS_* properties from the inheritance chain to avoid these
problems.
Fixes: #14408
(cherry picked from commit
19212f27816686a5cac2c965301cea8624ac467f)
Zbigniew Jędrzejewski-Szmek [Wed, 8 Jan 2020 09:39:44 +0000 (10:39 +0100)]
man: fix option name
(cherry picked from commit
95522092925ac7b3526211c9c0c35b5722b43e95)
ezst036 [Wed, 8 Jan 2020 00:47:15 +0000 (19:47 -0500)]
Support Plugable UD-PRO8 dock
Add support for Plugable Pro8 docking station for auto-configuring seat
(cherry picked from commit
95f2b4dd237faa57fd3e93245d560e47cdedfc2c)
Lennart Poettering [Tue, 7 Jan 2020 16:21:24 +0000 (17:21 +0100)]
gpt-auto: don't assume XBOOTLDR is vfat
Let's not assume "umask=" is a valid mount option for XBOOTLDR
partitions unconditionally.
Fixes: #14165
(cherry picked from commit
4f0840669e172a2570b17b0991459d3a6839f804)