Olivier Le Moal [Wed, 26 Aug 2020 14:03:35 +0000 (16:03 +0200)]
shell-completion/zsh: add missing verbs for networkctl
(cherry picked from commit
6ff45bc1a18855cb9b0c43ba13843c11dd10728f)
(cherry picked from commit
1f4cb5da1eb5970726a90262a8a3342906743436)
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)
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)
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)
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)
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)
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)
Zbigniew Jędrzejewski-Szmek [Sat, 22 Aug 2020 16:48:43 +0000 (18:48 +0200)]
nss-resolve: treat BUS_ERROR_NO_SUCH_UNIT the same as SD_BUS_ERROR_SERVICE_UNKNOWN too
Seems safer to do so.
(cherry picked from commit
8e34f4cc62aaeaa8881a1d6cd9136de5a22777a1)
(cherry picked from commit
d39f1393489f26a3a759fbf27f1b8e75d15939a2)
Zbigniew Jędrzejewski-Szmek [Sat, 22 Aug 2020 16:48:03 +0000 (18:48 +0200)]
various: treat BUS_ERROR_NO_SUCH_UNIT the same as SD_BUS_ERROR_SERVICE_UNKNOWN
We return BUS_ERROR_NO_SUCH_UNIT a.k.a. org.freedesktop.systemd1.NoSuchUnit
in various places. In #16813:
Aug 22 06:14:48 core sudo[
2769199]: pam_systemd_home(sudo:account): Failed to query user record: Unit dbus-org.freedesktop.home1.service not found.
Aug 22 06:14:48 core dbus-daemon[5311]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.home1.service': Unit dbus-org.freedesktop.home1.service not found.
Aug 22 06:14:48 core dbus-daemon[5311]: [system] Activating via systemd: service name='org.freedesktop.home1' unit='dbus-org.freedesktop.home1.service' requested by ':1.6564' (uid=0 pid=
2769199 comm="sudo su ")
This particular error comes from bus_unit_validate_load_state() in pid1:
case UNIT_NOT_FOUND:
return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s not found.", u->id);
It seems possible that we should return a different error, but it doesn't really
matter: if we change pid1 to return a different error, we still need to handle
BUS_ERROR_NO_SUCH_UNIT as in this patch to handle pid1 with current code.
(cherry picked from commit
73d3ac8e2440cda3b7f2310f329f0798de6c041c)
(cherry picked from commit
9bb3e64d715684865a1eb3c1ded60cf36d0d1cf2)
Lennart Poettering [Mon, 24 Aug 2020 17:41:09 +0000 (19:41 +0200)]
man: drop reference to long gone .busname unit type
Seems we missed one occurence.
(cherry picked from commit
68dd195c1b8fdba3fccf166a1c3c2d7ca5a912fe)
(cherry picked from commit
6d802dd5968a8265c4d0e0e4974135cbcb9c9f14)
Jan Chren [Mon, 24 Aug 2020 14:40:11 +0000 (16:40 +0200)]
man: fix a fix of a typo in systemd.service example
The fix from
cb263973acf83de22a86f08fe502a9cbd6c01d2b was made the other way around,
i.e. `SIGKILL` was changed to `SIGUSR1`, but the sentence is about a "termination signal", i.e. `SIGKILL`, not `SIGUSR1`.
(cherry picked from commit
be3f62faf5d498aaab4cf6ceb3ca56e0d994ddf5)
(cherry picked from commit
a29656804b51b957e6bfedee0bb92df327c1b45a)
Yu Watanabe [Fri, 21 Aug 2020 06:30:05 +0000 (15:30 +0900)]
man: fix invalid tag place
(cherry picked from commit
d91b9bbce881c7e0d2ee80208325be59924b0e8f)
(cherry picked from commit
0d8000522bca55bdfbaafd5690d3e0af9d54ee7b)
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)
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)
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)
Phaedrus Leeds [Wed, 19 Aug 2020 16:36:32 +0000 (09:36 -0700)]
man: Fix typo in systemd-tmpfiles
(cherry picked from commit
c2892a244c82ee142089f8fb7848547dada4ed32)
(cherry picked from commit
496a71f44483c54a2aa9569d2be5aceaa015664a)
Lennart Poettering [Mon, 17 Aug 2020 16:19:30 +0000 (18:19 +0200)]
homed: downgrade quota message in containers
quota syscalls and operations are typically prohibited in containers.
Let's not make noise about that, needlessly.
(cherry picked from commit
5e5e11b8744fbe9dcd87a2d165f342dc9bcd4008)
(cherry picked from commit
84e1ab74d274de2a43bfa4f67a81da97635fd27c)
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)
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)
Zbigniew Jędrzejewski-Szmek [Sun, 16 Aug 2020 14:19:29 +0000 (16:19 +0200)]
missing_syscall: do not use function name that may conflict with glibc
This was done for all replacements back in
5187dd2c403caf92d09f3491e41f1ceb3f10491f,
but some newer stuff didn't do this.
(cherry picked from commit
faeae444ea452139519718ceb681e8b5831b6890)
(cherry picked from commit
a2a3f16cdc16d32e1c685bbd469fb74b9aabdd71)
Zbigniew Jędrzejewski-Szmek [Sat, 15 Aug 2020 17:01:23 +0000 (19:01 +0200)]
missing_syscall: fix pidfd_{send_signal,open} numbers for alpha
Also order the syscalls by syscall number for easier comparisons with the
kernel headers.
Fixup for
5f152f43d04e5aad6a3f98f45f020a66e3aac717.
(cherry picked from commit
23654cee136862996d92e7f1e9887786ddb3dfe6)
(cherry picked from commit
4091dcd4699cc04d59068f86fa6d5e6c578e4eca)
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)
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)
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)
Lennart Poettering [Tue, 11 Aug 2020 12:50:32 +0000 (14:50 +0200)]
man: fix incorrectly placed full stop
(cherry picked from commit
6b49257f6b92c1bcdf02ca0e896009da36ed9bb0)
(cherry picked from commit
208ba581f44fe573f8c0e23025b639e402959149)
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)
Lennart Poettering [Thu, 6 Aug 2020 15:00:07 +0000 (17:00 +0200)]
user-record: deal with invalid GECOS fields gracefully
Let's fix up invalid GECOS fields both when we convert from NSS to JSON
and the other way round.
Kinda sucks we have to do that, but NSS does it when writing data to
/etc/passwd, so let's do the same.
Fixes: #16668
(cherry picked from commit
5cd12abaa0c0f3a06c9ff2048941fbe6e8b3577e)
(cherry picked from commit
4cfa0ac4fdc4e404f8361785c60c9f6061152d2f)
Lennart Poettering [Thu, 6 Aug 2020 14:46:18 +0000 (16:46 +0200)]
user-util: add mangle_gecos() call for turning strings into fields suitable as GECOS fields
(cherry picked from commit
b10fd796f56e4f16f7430cd22f59f544766d3bef)
(cherry picked from commit
ae5234ef483801bd12c465dfaba6d63bf286eac0)
Matt Fenwick [Fri, 7 Aug 2020 14:43:11 +0000 (10:43 -0400)]
fix typo in systemctl help
(cherry picked from commit
c1c28fe2f70573270b0544670dba38b3a2f06c13)
(cherry picked from commit
972391ac396f8fa39d06773338605af5a9d5507d)
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)
Zbigniew Jędrzejewski-Szmek [Sat, 1 Aug 2020 10:25:56 +0000 (12:25 +0200)]
analyze: fix 'cat-config systemd/zram-generator.conf'
Also makes this work for various systemd config files that support .d.
(cherry picked from commit
28365e88d0dfc6332b26120e23b2c39b7958f907)
(cherry picked from commit
f9ad4ea2ca06e7067da269743d6f7d70b9ae4864)
Zbigniew Jędrzejewski-Szmek [Mon, 3 Aug 2020 11:22:01 +0000 (13:22 +0200)]
man: describe that changing Storage= does not move existing data
Fixes #16384.
(cherry picked from commit
f254abcd72b6ca6c4567c245a7dbaf739d02dfc2)
(cherry picked from commit
dda6fec1dfc73d974827bbb540a043fc3ec76b18)
Etienne Doms [Sat, 1 Aug 2020 10:47:17 +0000 (12:47 +0200)]
man: fix typo in systemd.service
(cherry picked from commit
cb263973acf83de22a86f08fe502a9cbd6c01d2b)
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)
Lennart Poettering [Thu, 30 Jul 2020 16:42:13 +0000 (18:42 +0200)]
loop-device: implicitly sync device on detach
Apparently, if IO is still in flight at the moment we invoke LOOP_CLR_FD
it is likely simply dropped (probably because yanking physical storage,
such as a USB stick would drop it too). Let's protect ourselves against
that and always sync explicitly before we invoke it.
(cherry picked from commit
cae1e8fb88c5a6b0960a2d0be3df8755f0c78462)
Zbigniew Jędrzejewski-Szmek [Thu, 30 Jul 2020 13:15:11 +0000 (15:15 +0200)]
timesync: increase retry interval more slowly
The new retry intervals are [15, 20, 26, 34, 45, 60, 80, 106, 141, 188, 250,
333, 360, ...]. This should allow graceful response if a transient network
failure is encountered. Growth is exponential, but with a small power and
capped to a non-too-large value so that we resynchronize within a few minutes
after network is restored. I made the minimum 15 s to make sure that we never
send packets more often than that.
Fixes #16492.
(cherry picked from commit
5919bd3df32b2eec0accb54b23fcf0878d3914cd)
Yu Watanabe [Thu, 16 Jul 2020 17:56:29 +0000 (02:56 +0900)]
timedatectl: do not show (null) if the address of NTP server is not resolved
(cherry picked from commit
94ec163ad270e89be29bccc5d5edf1b038a29eae)
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)
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)
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)
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)
Lennart Poettering [Wed, 20 May 2020 15:14:51 +0000 (17:14 +0200)]
homed: when updating local copy of user record, sync to disk
Apparently xfs needs us to sync explicitly, see #15178.
(cherry picked from commit
e4005ffe00d321e027280147a9959ee6eb030cbf)
Lennart Poettering [Wed, 20 May 2020 15:14:48 +0000 (17:14 +0200)]
fileio: sync directory after rename, too
(cherry picked from commit
5b3f4a20ea164bba1f7bf65814c4236a18f9beb5)
Zbigniew Jędrzejewski-Szmek [Sun, 6 Sep 2020 10:46:34 +0000 (12:46 +0200)]
Allow nameserver list to be emptied
Based on
d96edb2c6e7014e93e6713c79a698c91463c8929.
Fixes #16959.
Zbigniew Jędrzejewski-Szmek [Mon, 27 Jul 2020 07:54:03 +0000 (09:54 +0200)]
hwdb: update based on v256-rc2
The autosuspend stuff is excluded.
Lennart Poettering [Tue, 19 May 2020 22:35:30 +0000 (00:35 +0200)]
rules: automatically pull in smartcard.target from all CCID devices
We apparently never matched the USB interface class. Let's fix that.
Prompted by: #15676
(cherry picked from commit
1b1b7b44ccbc68f49ce0da5ee1aaeb32587f2a49)
Lennart Poettering [Tue, 16 Jun 2020 14:50:46 +0000 (16:50 +0200)]
nspawn: mkdir selinux mount point once, but not twice
Since #15533 we didn't create the mount point for selinuxfs anymore.
Before it we created it twice because we mount selinuxfs twice: once the
superblock, and once we remount its bind mound read-only. The second
mkdir would mean we'd chown() the host version of selinuxfs (since
there's only one selinuxfs superblock kernel-wide).
The right time to create mount point point is once: before we mount the
selinuxfs. But not a second time for the remount.
Fixes: #16032
(cherry picked from commit
6fe01ced0e081a9a1d9d484b4bd87a9ae567ae19)
Christian Göttsche [Sat, 25 Jul 2020 16:23:11 +0000 (18:23 +0200)]
Fix clang-11 issues
Tested with clang 11.0.0-++
20200715043845+
0e377e253c1-1~exp1 on Debian sid
../src/network/test-networkd-conf.c:104:56: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
test_config_parse_duid_rawdata_one(BYTES_0_128 + 2, 0, &(DUID){0, 128, BYTES_1_128});
~~~~~~~~~~~~^~~
../src/network/test-networkd-conf.c:104:56: note: use array indexing to silence this warning
test_config_parse_duid_rawdata_one(BYTES_0_128 + 2, 0, &(DUID){0, 128, BYTES_1_128});
^
& [ ]
1 warning generated.
../src/test/test-clock.c:52:17: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
ftruncate(fileno(f), 0);
^~~~~~~~~ ~~~~~~~~~~~~
1 warning generated.
(gdb) run
Starting program: systemd/build/test-alloc-util
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
x1: 0x7fffffffd2d0
x2: 0x7fffffffdac0
y: 0x7fffffffd2cc
z: 0x7fffffffd2c0
cleanup2(0x7fffffffd2cc)
cleanup3(0x7fffffffd2c0)
cleanup1(0x7fffffffdac0)
cleanup1(0x7fffffffd2d0)
*** buffer overflow detected ***: terminated
Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt full
set = {__val = {0,
18446744073709551615, 0, 0, 0, 0,
140737348658240,
140737348659520, 0, 0, 0, 0, 0, 0, 0, 0}}
pid = <optimized out>
tid = <optimized out>
ret = <optimized out>
save_stage = 1
act = {__sigaction_handler = {sa_handler = 0x22ff0, sa_sigaction = 0x22ff0}, sa_mask = {__val = {
140737349888603,
4217127,
4217127,
4217127,
4217127,
4217383, 0, 0, 0, 0, 143329, 143344,
140737351162752, 8959,
18446744073709551328,
4289072}},
sa_flags = -
138460788, sa_restorer = 0xffffffffffffffff}
sigs = {__val = {32, 0 <repeats 15 times>}}
ap = {{gp_offset = 24, fp_offset = 0, overflow_arg_area = 0x7fffffffd280, reg_save_area = 0x7fffffffd210}}
fd = <optimized out>
list = <optimized out>
nlist = <optimized out>
cp = <optimized out>
No locals.
No locals.
No locals.
No locals.
No locals.
l = 0
No locals.
p1 = 0x405500 "\223Nd\n\351\301mA\214\262A\247\306b\276\317\327\353\346k\035\024\273{\276&!kλ\233\217\t\207\276\327\347\351\355\307R\276\063{\235w=\237E\357\277KL\245\374\245\066M\201+\333\064\272\332g>1<@"
p2 = <optimized out>
i = <optimized out>
No locals.
(cherry picked from commit
c8f12abc7382f3302ec9fc5152f1a711c4515f6b)
Axel Rasmussen [Thu, 23 Jul 2020 17:54:23 +0000 (10:54 -0700)]
selinux: handle getcon_raw producing a NULL pointer, despite returning 0
Previously, we assumed that success meant we definitely got a valid
pointer. There is at least one edge case where this is not true (i.e.,
we can get both a 0 return value, and *also* a NULL pointer):
https://github.com/SELinuxProject/selinux/blob/
4246bb550dee5246c8567804325b7da206cd76cf/libselinux/src/procattr.c#L175
When this case occurrs, if we don't check the pointer we SIGSEGV in
early initialization.
(cherry picked from commit
199a892218e1f36e7bd7d5da2d78de6b13f04488)
Lennart Poettering [Thu, 23 Jul 2020 09:13:44 +0000 (11:13 +0200)]
nspawn: fix MS_SHARED mount propagation for userns containers
We want our OS trees to be MS_SHARED by default, so that our service
namespacing logic can work correctly. Thus in nspawn we mount everything
MS_SHARED when organizing our tree. We do this early on, before changing
the user namespace (if that's requested). However CLONE_NEWUSER actually
resets MS_SHARED to MS_SLAVE for all mounts (so that less privileged
environments can't affect the more privileged ones). Hence, when
invoking it we have to reset things to MS_SHARED afterwards again. This
won't reestablish propagation, but it will make sure we get a new set of
mount peer groups everywhere that then are honoured for the mount
namespaces/propagated mounts set up inside the container further down.
(cherry picked from commit
2a2e78e969d9549502066af90217104461d908e6)
Zbigniew Jędrzejewski-Szmek [Thu, 23 Jul 2020 07:03:58 +0000 (09:03 +0200)]
man: do not say that isolate is like switching runlevels
We need to do better here, but for now let's at least not trick
users into nuking their graphical environment. Inspired by #16548.
(cherry picked from commit
5cf821acf8bb65a265e38a5756871ab630255c8f)
Zbigniew Jędrzejewski-Szmek [Wed, 22 Jul 2020 13:49:29 +0000 (15:49 +0200)]
pid1: target units can fail through dependencies
Fixes #16401.
c80a9a33d04fb4381327a69ce929c94a9f1d0e6c introduced the .can_fail field,
but didn't set it on .targets. Targets can fail through dependencies.
This leaves .slice and .device units as the types that cannot fail.
$ systemctl cat bad.service bad.target bad-fallback.service
[Service]
Type=oneshot
ExecStart=false
[Unit]
OnFailure=bad-fallback.service
[Service]
Type=oneshot
ExecStart=echo Fixing everythign!
$ sudo systemctl start bad.target
systemd[1]: Starting bad.service...
systemd[1]: bad.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: bad.service: Failed with result 'exit-code'.
systemd[1]: Failed to start bad.service.
systemd[1]: Dependency failed for bad.target.
systemd[1]: bad.target: Job bad.target/start failed with result 'dependency'.
systemd[1]: bad.target: Triggering OnFailure= dependencies.
systemd[1]: Starting bad-fallback.service...
echo[46901]: Fixing everythign!
systemd[1]: bad-fallback.service: Succeeded.
systemd[1]: Finished bad-fallback.service.
(cherry picked from commit
94d1ddbd7cd15b1073757eb5ae0645c83f0b414c)
Zbigniew Jędrzejewski-Szmek [Wed, 22 Jul 2020 10:51:15 +0000 (12:51 +0200)]
Revert "units: drop OnFailure= from .target units"
This reverts commit
c7220ca8025e8dbded36131b23a502d975c45754.
The removal was done as a reaction to the messages from systemd:
initrd-root-fs.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail).
initrd.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail).
initrd-root-device.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail).
initrd-fs.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail).
local-fs.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail).
...
But it seems that the messages themselves are wrong, and the units were OK.
(cherry picked from commit
74c8e3c4e082121d8bc578d07d7a3843c61c2bd1)
Zbigniew Jędrzejewski-Szmek [Mon, 20 Jul 2020 06:22:45 +0000 (08:22 +0200)]
Revert "man: add note about systemd-vconsole-setup.service and tty as input/output"
This reverts commit
0b578036301d7c3f2dab8df1f31f0121552a4e10.
From https://github.com/systemd/systemd/pull/16503#issuecomment-
660212813:
systemd-vconsole-setup (the binary) is supposed to run asynchronously by udev
therefore ordering early interactive services after systemd-vconsole-setup.service
has basically no effect.
Let's remove this paragraph. It's better to say nothing than to give pointless
advice.
(cherry picked from commit
8fa2cd83c6ecc9400bb3621aafd6c1e499b1ae0d)
Lennart Poettering [Tue, 21 Jul 2020 09:13:54 +0000 (11:13 +0200)]
import: always prefer GNU tar, to avoid cmdline incompatibilities
Fixes: #16506
(cherry picked from commit
c400d040cee32b90fa7f06742d0725c79d30339f)
Hans de Goede [Mon, 20 Jul 2020 13:06:43 +0000 (15:06 +0200)]
logind: Fix org.freedesktop.login1.set-reboot-to-boot-loader-menu saving to the wrong file in the non EFI case
According to the docs, and to the
org.freedesktop.login1.get-reboot-to-boot-loader-menu code, the
(oneshot) boot-loader-menu timeout should be stored in
/run/systemd/reboot-to-boot-loader-menu, but the set method was storing it
in /run/systemd/reboot-to-loader-menu.
This commit fixes this. Note that the fixed name also is a better match
for the dbus call names and matches the related
/run/systemd/reboot-to-boot-loader-entry structure, so fixing the set code,
rather then the get code + docs seems like the right thing to do here.
(cherry picked from commit
3a978b30cd822faef304e790c5740e1587a79e0e)
Franck Bui [Thu, 16 Jul 2020 19:22:37 +0000 (21:22 +0200)]
vconsole-setup: downgrade log message when setting font fails on dummy console
Since commit
883eb9be985fd86d9cabe967eeeab91cdd396a81, vconsole-setup might be
called again to operate on dummy console where font operations are not
supported but where it's still important to have the correct keymap set [0][1].
vconsole-setup is mainly called by udev but can also be run via a dependency of
an early service. Both cases might end up calling vconsole-setup on the dummy
console.
The first case can happen during early boot even on systems that use (instead
of the dummy console) a "simple" video console driver supporting font
operations (such as vgacon) until a more specific driver (such as i915) takes
the console over. While this is happening vgacon is deactivated and temporarly
replaced by the dummy console [2].
There are also other cases where systemd-vconsole-setup might be called on
dummy console especially during (very) early boot. Indeed
systemd-vconsole-setup.service might be pulled in by early interactive services
such as 'dracut-cmdline-ask.service` which is run before udev.
If that happens on platforms with no grapical HWs (such as embedded ARM) or
with dummy console initially installed until a driver takes over (like Xen and
xen-fbfront) then setting font will fail.
Therefore this patch downgrades the log message emitted when setting font fails
to LOG_DEBUG and when font operations is not implemented like it's the case for
the dummy console.
Fixes: #16406.
[0] https://github.com/systemd/systemd/issues/10826
[1] https://bugzilla.redhat.com/show_bug.cgi?id=
1652473
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/vga/vgaarb.c?h=v5.7#n204
(cherry picked from commit
0ef1adf51274960358e852d3bc36ae6c288a70d9)
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 14:12:42 +0000 (16:12 +0200)]
udev: don't complain when udev_watch_end() is called without udev_watch_init()
E.g. udevadm test prints "Invalid inotify descriptor." which is
meaningless without any context. I think it should be OK to call udev_watch_end()
from a cleanup path without any warning (even at debug level).
(cherry picked from commit
d6d4961b01a986984f018bae141eabbce83f0e20)
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 12:56:16 +0000 (14:56 +0200)]
man: add more details for IMPORT, PROGRAM and RUN keys
967de8faceaa83c11a1215515cb135d7a8c0c32c added a note that I found very hard
to understand. Reword it, and also describe how IMPORT and PROGRAM are different
from RUN.
Minor markup adjustements too.
(cherry picked from commit
12254ccab0b7c1af02d07bb216edf81ac3a2aba4)
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 14:04:35 +0000 (16:04 +0200)]
udev: accept OPTIONS+= without any fuss
There is no reason to consider this wrong. In fact one could argue that +=
is more appropriate, because we always add to options, and not replace previous
assignments. If we output a debug message, we implicitly ask people to "fix" this,
and we shouldn't.
Also, all our rules use += right now.
(cherry picked from commit
ba60127df7bcc8263ae94092aca972b9f11c70ec)
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jul 2020 11:56:57 +0000 (13:56 +0200)]
udev: accept IMPORT{}= without any fuss
Udev logs are full of messages about wrong operator type:
...
Reading rules file: /usr/lib/udev/rules.d/60-persistent-storage.rules
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:30 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:54 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:57 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:60 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:63 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:66 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:67 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:93 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:107 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:110 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-storage.rules:113 IMPORT key takes '==' or '!=' operator, assuming '=='.
Reading rules file: /usr/lib/udev/rules.d/60-persistent-v4l.rules
/usr/lib/udev/rules.d/60-persistent-v4l.rules:7 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-v4l.rules:9 IMPORT key takes '==' or '!=' operator, assuming '=='.
/usr/lib/udev/rules.d/60-persistent-v4l.rules:16 IMPORT key takes '==' or '!=' operator, assuming '=='.
...
The warning was downgraded in
f0beb6f816035e438d684cc52ae76fc4a44fc197, but I
think it should be removed altogether. IMPORT{program}="asdf" seems like an
obvious way to write this, and people don't expect to have to write "==".
So let's just allow any operator.
(cherry picked from commit
b6a80b83bc1c5d7f019b6c15025dda9a423d1fc7)
Anita Zhang [Thu, 16 Jul 2020 18:36:28 +0000 (11:36 -0700)]
analyze: CAP_RAWIO -> CAP_SYS_RAWIO
Fixes #16489
(cherry picked from commit
b5ef66101a7b1126b67fa58c68fb3ef246327276)
Lennart Poettering [Wed, 15 Jul 2020 15:44:03 +0000 (17:44 +0200)]
load-fragment: downgrade log messages we ignore to LOG_WARNING
We typically don't log above LOG_WARNING about issues we then go on to
ignore. Do so here, too
(cherry picked from commit
330f89907911f533f35639f58880eda4462d06a8)
Lennart Poettering [Wed, 15 Jul 2020 15:43:10 +0000 (17:43 +0200)]
mountpoint-util: fix error handling
(cherry picked from commit
89a5385fb7d8a1e6fdd59d8469dd14f14496cad5)
Lennart Poettering [Wed, 15 Jul 2020 16:49:08 +0000 (18:49 +0200)]
core: fix invalid assertion
We miscounted here, and would hit an assert once too early.
(cherry picked from commit
8d5bb13d7821da9ea84ccd3c4101aa50f9296022)
Zbigniew Jędrzejewski-Szmek [Tue, 14 Jul 2020 14:30:46 +0000 (16:30 +0200)]
rpm: include macro name in errors for two args macros too
(cherry picked from commit
1061fc1c1734ae67afe015fb6adbf25fa247b407)
Zbigniew Jędrzejewski-Szmek [Tue, 14 Jul 2020 14:25:32 +0000 (16:25 +0200)]
rpm: adjust various macros to print macro name in the error message
Based on initial patch by Jan Engelhardt <jengelh@inai.de>.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=
1856122.
(cherry picked from commit
281014b73ee044e83b9df8706adf2e324f08f746)
Mikhail Novosyolov [Sat, 11 Jul 2020 14:13:54 +0000 (17:13 +0300)]
rpm: avoid hiding errors and output in *_create_package macros
Commit
b0ca726585 "rpm: avoid hiding errors from systemd commands" remove hiding errors and output
for other macros, but did not do that for %sysusers_create_package and %tmpfiles_create_package.
This change syncs their behaviour with %sysusers_create and %tmpfiles_create
Signed-off-by: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
(cherry picked from commit
3e6e0856cd98dd091137c4565bd5ccefd16ab832)
Mikhail Novosyolov [Sat, 11 Jul 2020 14:08:00 +0000 (17:08 +0300)]
rpm: avoid odd symbols in EOF indicator
The last line in this macros was actually "SYSTEMD_INLINE_EOF " with a space at the end,
but the shell was instructed to look for a line without space.
Macros %sysusers_create_inline and %tmpfiles_create_inline did not have this mistake.
An example:
[root@rosa-2019 bind-server]# cat /etc/passwd | grep named
[root@rosa-2019 bind-server]# cat /tmp/bs
systemd-sysusers --replace=/usr/lib/sysusers.d/named.conf - <<SYSTEMD_INLINE_EOF >/dev/null 2>&1 || :
u named - "BIND DNS Server" /var/lib/named
g named - -
m named named
SYSTEMD_INLINE_EOF
[root@rosa-2019 bind-server]# sh /tmp/bs
/tmp/bs: line 5: warning: here-document at line 1 delimited by end-of-file (wanted `SYSTEMD_INLINE_EOF')
[root@rosa-2019 bind-server]# bash /tmp/bs
/tmp/bs: line 5: warning: here-document at line 1 delimited by end-of-file (wanted `SYSTEMD_INLINE_EOF')
[root@rosa-2019 bind-server]# bash --version
GNU bash, version 5.0.17(1)-release (x86_64-openmandriva-linux-gnu)
The user and group named were NOT created!
Now I remove the trailing space after "SYSTEMD_INLINE_EOF" and rerun:
[root@rosa-2019 bind-server]# sh /tmp/bs
[root@rosa-2019 bind-server]# tail -n 1 /etc/group
named:x:485:named
[root@rosa-2019 bind-server]#
The user and group have been created correctly.
Signed-off-by: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
(cherry picked from commit
93406fd379d3ba184eec2eb664729edef1bca995)
gaoyi [Sun, 12 Jul 2020 07:27:45 +0000 (03:27 -0400)]
test: add test case for multi matches when use "||"
Signed-off-by: gaoyi <ymuemc@163.com>
(cherry picked from commit
0d3a8bc7ebd76591e14f7098b4266fd2065ac4db)
gaoyi [Sun, 12 Jul 2020 07:24:42 +0000 (03:24 -0400)]
udev: specify the end of value
NULSTR_FOREACH may read the illegal match
Signed-off-by: gaoyi <ymuemc@163.com>
(cherry picked from commit
1e67a9c2cd6065b850d2fd5e376d8b9bff63bdbc)
Zbigniew Jędrzejewski-Szmek [Thu, 9 Jul 2020 21:15:47 +0000 (23:15 +0200)]
basic/cap-list: parse/print numerical capabilities
We would refuse to print capabilities which were didn't have a name
for. The kernel adds new capabilities from time to time, most recently
cap_bpf. 'systmectl show -p CapabilityBoundingSet ...' would fail with
"Failed to parse bus message: Invalid argument" because
capability_set_to_string_alloc() would fail with -EINVAL. So let's
print such capabilities in hexadecimal:
CapabilityBoundingSet=cap_chown cap_dac_override cap_dac_read_search
cap_fowner cap_fsetid cap_kill cap_setgid cap_setuid cap_setpcap
cap_linux_immutable cap_net_bind_service cap_net_broadcast cap_net_admin
cap_net_raw cap_ipc_lock cap_ipc_owner 0x10 0x11 0x12 0x13 0x14 0x15 0x16
0x17 0x18 0x19 0x1a ...
For symmetry, also allow capabilities that we don't know to be specified.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=
1853736.
(cherry picked from commit
417770f3033c426ca848b158d0bf057cd8ad1329)
Franck Bui [Thu, 11 Jun 2020 07:41:14 +0000 (09:41 +0200)]
fstab-generator: extra dependencies specified in fstab should be applied to the mount unit
If an entry in fstab uses "x-systemd.automount" option and also asks for
additionnal dependencies via x-systemd.requires or such, then the dependencies
were applied to the automount unit.
But this unlikely to do the right thing and is inconsistent with what's done
for network mounts.
Indeed when an fstab entries has "_netdev,x-systemd.automount" options, the
dependencies against the network requested by "_netdev" are (correctly) applied
to the mount unit only and the automount unit remains ordered against
local-fs.target.
The same logic should be followed when extra deps are specified via the mount
options as automount units should always be ordered against local-fs.target.
Note: in general explicit deps specified via mount options should be used with
care and should be used to specify dependencies on other mount units only as it
can easily create ordering cycles otherwise like it's been seen in
https://github.com/systemd/systemd-stable/issues/69. Mount units (as well as
automount ones) are ordered before local-fs.target by default which is a
low-level target that most other units depend on.
(cherry picked from commit
045c5faf5a3ef51cd39f738694e06c11a73f54b7)
Zbigniew Jędrzejewski-Szmek [Mon, 6 Jul 2020 14:21:34 +0000 (16:21 +0200)]
networkd: we should not loop when extract_first_word() fails
While at it, define iterator in the loop to reduce the indentation a bit.
(cherry picked from commit
1f68f77292a9581dd77be9a0bd279c1430cbd130)
Zbigniew Jędrzejewski-Szmek [Mon, 6 Jul 2020 14:31:57 +0000 (16:31 +0200)]
man: do not say that tasks are threads and processes
This is confusing because the reader might think that processes and threads are
counted separately. Another issue pointed out in #16363.
(cherry picked from commit
8dc647fd305d23380cb1b1a9123e31f0fcc9a4e9)
Dan Callaghan [Fri, 3 Jul 2020 09:13:08 +0000 (19:13 +1000)]
core: set private section name for automount units
Because this was left unset, the unit_write_setting() function was
refusing to write out the automount-specific TimeoutIdleSec= and
DirectoryMode= settings when creating transient automount units.
Set it to the proper value in line with other unit types.
(cherry picked from commit
2fadbb4535108406384a5d63c1ad3082f845c646)
Yu Watanabe [Tue, 30 Jun 2020 10:41:39 +0000 (19:41 +0900)]
backlight: read current backlight brightness from 'actual_brightness' attribute
Closes #16302.
(cherry picked from commit
437b9a7f7581d3ed3f05d76ff0116767d0a3b726)
Yu Watanabe [Tue, 30 Jun 2020 10:29:42 +0000 (19:29 +0900)]
backlight: call log_setup_service() before logging
(cherry picked from commit
daa227a3201e5d443c670e9d585188684be73a1d)
Yu Watanabe [Tue, 30 Jun 2020 10:28:50 +0000 (19:28 +0900)]
backlight: use SYNTHETIC_ERRNO() macro
(cherry picked from commit
74f1bb5c9fadd96c7753597aaeeebd96cf0c99f4)
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)
Yu Watanabe [Tue, 30 Jun 2020 05:44:41 +0000 (14:44 +0900)]
shell-completion: add missing verbs for networkctl
(cherry picked from commit
e4f8d5e01f50cf9d43cac7c05a997a0dfd78b64e)
Gaoyi [Fri, 26 Jun 2020 05:55:41 +0000 (13:55 +0800)]
Add quotes for -n
According to SC2070, -n doesn't work with unquoted arguments
https://github.com/koalaman/shellcheck/wiki/SC2070
Signed-off-by: Gaoyi <ymuemc@163.com>
(cherry picked from commit
0090b551e6ba2708a736371baeaf0bdfd781a5aa)
Łukasz Stelmach [Wed, 24 Jun 2020 17:24:13 +0000 (19:24 +0200)]
udev: split attribute assignment for MMC cards
Some cards have names consisting only of whitespace characters which
prevents the original rule from matching and assigning ID_SERIAL
properly. With the split rules ID_SERIAL and ID_NAME are assigned
independently and the symlink is created only if both are available the
same way it has worked for partitions.
(cherry picked from commit
fdf3e48c447a6e0d810563a641ef28b98d3f9d8c)
Luca Boccassi [Tue, 23 Jun 2020 14:56:33 +0000 (15:56 +0100)]
portabled: create temp file for unit, not directory
open_tmpfile_linkable is used to create a temporary file in the same
directory as the target, but portabled uses the name of the parent
directory instead of the file it intends to create.
In other words, it creats a tmp for /etc/systemd/system.attached instead
of /etc/systemd/system.attached/foo.service.
It still works because it's later moved in the right place.
But as a side effect, it tries the create the file in the parent directory
which is /etc/systemd, and it case of read-only filesystems it fails.
(cherry picked from commit
6d88513e6b4fe36f59d3c5702a22ab796dea7852)
Michael Chapman [Tue, 5 May 2020 03:38:25 +0000 (13:38 +1000)]
core/path: use escaped path in serialization
(cherry picked from commit
f285f07752d784e5fa1b84ac8cbc263c488eccd1)
Michal Koutný [Wed, 24 Jun 2020 10:43:22 +0000 (12:43 +0200)]
missing: Add new Linux capabilities
Linux kernel v5.8 adds two new capabilities. Make sure we can recongize
them even when built with older kernel.
(cherry picked from commit
e41de5e491942b5391b1efb71c82ffd329b3d23d)
Lennart Poettering [Tue, 23 Jun 2020 15:06:42 +0000 (17:06 +0200)]
man: s/PROGRAMM/PROGRAM/
(cherry picked from commit
92d64d144457d460992732f0540f28e1a7685124)
Dave Reisner [Thu, 11 Jun 2020 14:34:13 +0000 (10:34 -0400)]
Revert "job: Don't mark as redundant if deps are relevant"
This reverts commit
097537f07a2fab3cb73aef7bc59f2a66aa93f533.
At least Fedora and Debian have already reverted this at the distro
level because it causes more problems than it solves. Arch is debating
reverting it as well [0] but would strongly prefer that this happens
upstream first. Fixes #15188.
[0] https://bugs.archlinux.org/task/66458
(cherry picked from commit
cc479760b4736082d26ec332f2423a9ab23d59c5)
наб [Thu, 18 Jun 2020 23:55:09 +0000 (01:55 +0200)]
man/sd-makefs: link to btrfs.wiki. for btrfs-man5, since the man-pages link is dead
This also adds a <citerefentry project="url"> type,
since the other btrfs manpages use man-pages/die-net and are alive,
and btrfs.w.k.o won't be used anywhere else
(cherry picked from commit
affa893da0715cbb7a865f6363b6092097d5e161)
наб [Thu, 18 Jun 2020 23:15:20 +0000 (01:15 +0200)]
man/sd-makefs: also mention /sbin/mkswap
(cherry picked from commit
c2ad8c0978159cacffb3f10743989661ae440566)
Elisei Roca [Tue, 23 Jun 2020 05:42:15 +0000 (07:42 +0200)]
test-functions: read /usr/etc/nsswitch.conf if /etc/nsswitch.conf does not exist (#16195)
See this for more info why and since when this change is needed: https://build.opensuse.org/request/show/807179.
(cherry picked from commit
9e1732924d5b69647e8020c98796748d9b0ad926)
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jun 2020 15:09:49 +0000 (17:09 +0200)]
bus-message: avoid dereferencing a NULL pointer
We'd try to map a zero-byte buffer from a NULL pointer, which is undefined behaviour.
src/systemd/src/libsystemd/sd-bus/bus-message.c:3161:60: runtime error: applying zero offset to null pointer
#0 0x7f6ff064e691 in find_part /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-message.c:3161:60
#1 0x7f6ff0640788 in message_peek_body /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-message.c:3283:16
#2 0x7f6ff064e8db in enter_struct_or_dict_entry /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-message.c:3967:21
#3 0x7f6ff06444ac in bus_message_enter_struct /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-message.c:4009:13
#4 0x7f6ff0641dde in sd_bus_message_enter_container /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-message.c:4136:21
#5 0x7f6ff0619874 in sd_bus_message_dump /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-dump.c:178:29
#6 0x4293d9 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/fuzz/fuzz-bus-message.c:39:9
#7 0x441986 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:558:15
#8 0x44121e in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /src/libfuzzer/FuzzerLoop.cpp:470:3
#9 0x443164 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__1::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/libfuzzer/FuzzerLoop.cpp:770:7
#10 0x4434bc in fuzzer::Fuzzer::Loop(std::__1::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/libfuzzer/FuzzerLoop.cpp:799:3
#11 0x42d2bc in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:846:6
#12 0x42978a in main /src/libfuzzer/FuzzerMain.cpp:19:10
#13 0x7f6fef13c82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#14 0x407808 in _start (out/fuzz-bus-message+0x407808)
(cherry picked from commit
b17af3e503a5861ae1437254a8a2a3600e768cc4)
Mark Pearson [Tue, 9 Jun 2020 13:27:58 +0000 (09:27 -0400)]
Added rules for Wacom Pen and EMV Smartcard Reader
(cherry picked from commit
7cb375e69179e80da261234abb5b53663a17eb9b)
[zjs: This is from https://github.com/systemd/systemd/pull/16113. For v246
a much complicated fix was merged. Let's use this simple one in the stable
branch.]
Lennart Poettering [Tue, 16 Jun 2020 12:38:44 +0000 (14:38 +0200)]
repart: if now minimal size is specified, default to 10M
Prompted by this discussion:
https://lists.freedesktop.org/archives/systemd-devel/2020-June/044669.html
(cherry picked from commit
fb08381c14b49d9878b838f15b0aeb1e16b59d98)
Yu Watanabe [Thu, 18 Jun 2020 04:48:45 +0000 (13:48 +0900)]
udev: udev_event_apply_format() always make buf NUL terminated
The return value of udev_event_apply_format() is always ignored.
So, the destination buffer must be always NUL terminated.
(cherry picked from commit
5eb6ef8b452ef15788cc0c7d176be38a2cef8ca2)
Yu Watanabe [Thu, 18 Jun 2020 04:48:44 +0000 (13:48 +0900)]
udev: fix error handling of sd_device_get_parent()
sd_device_get_parent() returns -EINVAL or -ENOENT on error, not -ENODEV.
Fixes #16207.
(cherry picked from commit
bc568a7a35f04cb052eadcd068e14fe60f6a5c0d)
Luca Boccassi [Mon, 15 Jun 2020 18:50:56 +0000 (19:50 +0100)]
efi: use stub for cache_efi_options_variable if !ENABLE_EFI
../src/core/main.c: In function 'main':
../src/core/main.c:2637:32: error: implicit declaration of function 'cache_efi_options_variable'; did you mean 'systemd_efi_options_variable'? [-Werror=implicit-function-declaration]
(void) cache_efi_options_variable();
^~~~~~~~~~~~~~~~~~~~~~~~~~
systemd_efi_options_variable
(cherry picked from commit
8d2d64166e1bb5978b5392b2787d1dd8feb63c16)
Filipe Brandenburger [Thu, 11 Jun 2020 22:33:32 +0000 (15:33 -0700)]
efi: Skip parsing SystemdOptions if there's an error getting it.
The original logic was logging an "ignored" debug message, but it was still
going ahead and calling proc_cmdline_parse_given() on the NULL line. Fix that
to skip that explicitly when the EFI variable wasn't really read.
(cherry picked from commit
7283fbfd0c46819fea9f0a20671eaef99b3993e5)
Daan De Meyer [Sat, 13 Jun 2020 12:48:40 +0000 (14:48 +0200)]
resolved: Log the feature level we're downgrading from as well
(cherry picked from commit
4f571b4061f32a0d45371453470f55e858ee8c57)
Daan De Meyer [Fri, 12 Jun 2020 18:17:15 +0000 (20:17 +0200)]
resolved: Don't complain too much when downgrading from EDNS
(cherry picked from commit
e034886b8022e871300e69418171bda00f937220)