Lennart Poettering [Wed, 17 Mar 2021 22:26:49 +0000 (23:26 +0100)]
Merge pull request #19011 from anitazha/pgscanrate
oomd: update pressure based kills to use pgscan rate
Lennart Poettering [Wed, 17 Mar 2021 21:45:16 +0000 (22:45 +0100)]
Merge pull request #19034 from poettering/read-virtual-file-fix
read_virtual_file() tweaks
Anita Zhang [Wed, 17 Mar 2021 00:57:50 +0000 (17:57 -0700)]
oomd: clean up error handling
- Log debug if we're going to ignore an error
- Add %m if we use log_*_errno()
- log_oom() when checking ENOMEM
Lennart Poettering [Wed, 17 Mar 2021 20:03:02 +0000 (21:03 +0100)]
Merge pull request #19031 from poettering/hwdb-248
prepare 248-rc4
Luca Boccassi [Wed, 17 Mar 2021 14:34:36 +0000 (14:34 +0000)]
resolved: simplify min_ttl check
rr is asserted upon a few lines above, no need to check for null.
Coverity-found issue, CID
1450844
CID
1450844: Null pointer dereferences (REVERSE_INULL)
Null-checking "rr" suggests that it may be null, but it has already
been dereferenced on all paths leading to the check.
Lennart Poettering [Wed, 17 Mar 2021 17:48:01 +0000 (18:48 +0100)]
fileio: add missing overflow checks to read_full_virtual_file()
given the source is trusted this is probably not a biggie, but let's
better be safe than sorry.
Lennart Poettering [Wed, 17 Mar 2021 17:46:56 +0000 (18:46 +0100)]
fileio: don't use realloc() in read_full_virtual_file()
We aren't interested in the data previousl read, hence free() followed
by malloc() is typically better since it means libc doesn't have to
restore the contained data needlessly.
Lennart Poettering [Wed, 17 Mar 2021 17:44:51 +0000 (18:44 +0100)]
systemctl: pecify read_full_file() size argument as NULL
If it is specified as NULL read_full_file() assumes the caller wants a C
string, and it looks for embedded NUL bytes to ensure that works. Given
we don#t actually use the size argument here, let's drop it.
(in one case the size argument is used, but not for actually processing
the full returned data, but just as a shortcut to compare things with
the original string. Let's drop use of that there, too given the risk of
embedded NUL bytes in the data read.)
Lennart Poettering [Wed, 17 Mar 2021 17:43:42 +0000 (18:43 +0100)]
tree-wide: use read_full_virtual_file() where appropriate
Wherever we read virtual files we better should use
read_full_virtual_file(), to make sure we get a consistent response
given how weird the kernel's handling with partial read on such file
systems is.
Anita Zhang [Tue, 16 Mar 2021 00:38:45 +0000 (17:38 -0700)]
oomctl: show last_pgscan
Anita Zhang [Tue, 16 Mar 2021 00:21:45 +0000 (17:21 -0700)]
oomd: sort by pgscan rate not pgscan
For pressure based killing we want to target who has the highest
increase in pgscan from the previous interval (vs. the previous logic
which used raw pgscan). This will prevent biasing towards long running
cgroups as mentioned in #19007.
Lennart Poettering [Wed, 17 Mar 2021 17:13:51 +0000 (18:13 +0100)]
update TODO
Lennart Poettering [Wed, 17 Mar 2021 15:07:49 +0000 (16:07 +0100)]
update NEWS for rc4
Lennart Poettering [Wed, 17 Mar 2021 15:50:27 +0000 (16:50 +0100)]
tools: exclude Weblate bot from "ninja git-contrib"
Bots are not people, no reason to say thanks to them and list them as
authors or contributors.
Lennart Poettering [Wed, 17 Mar 2021 15:46:02 +0000 (16:46 +0100)]
mailmap: merge Weblate bot commiter into one
Lennart Poettering [Wed, 17 Mar 2021 15:11:12 +0000 (16:11 +0100)]
meson.build: bump version of libudev
It didn't receive new API calls, bit it was changed, hence bump the
version accordingly.
Lennart Poettering [Wed, 17 Mar 2021 14:58:15 +0000 (15:58 +0100)]
hwdb: ninja update-hwdb
Lennart Poettering [Wed, 17 Mar 2021 14:52:16 +0000 (15:52 +0100)]
hwdb: ninja update-hwdb-autosuspend
Luca Boccassi [Wed, 17 Mar 2021 15:26:13 +0000 (15:26 +0000)]
doc/RELEASE.md: document hwdb update step
igo95862 [Tue, 16 Mar 2021 18:43:12 +0000 (21:43 +0300)]
man: Specify that only d-bus methods can be answered async
Not properties.
Dan Sanders [Wed, 17 Mar 2021 02:09:05 +0000 (19:09 -0700)]
hwdb: unifying receiver match keys for Logitech MX Ergo
Mike Gilbert [Tue, 9 Mar 2021 22:57:37 +0000 (17:57 -0500)]
cg_unified_cached: return ENOMEDIUM if we cannot find a known hierarchy
When the test suite is being run in a foreign environment,
/sys/fs/cgroup might not be set up in a way that we recognize.
Returning ENOMEDIUM causes the tests to be skipped in this case.
Bug: https://bugs.gentoo.org/771819
Anita Zhang [Mon, 15 Mar 2021 23:34:26 +0000 (16:34 -0700)]
oomd: update memory pressure candidates every interval
Anita Zhang [Mon, 15 Mar 2021 23:06:42 +0000 (16:06 -0700)]
oomd: new helper oomd_update_cgroup_contexts_between_hashmaps
Yu Watanabe [Tue, 16 Mar 2021 15:23:51 +0000 (00:23 +0900)]
dhcp6: fix wrong length for IA_PD dhcp6 option
Fixes an issue introduced by
73b49d433c2c8e6304c8b82538bd4231d070fce4.
When PrefixDelegationHint= is not set, dhcp6_option_append_pd() sets
wrong length for IA_PD option, as `r` is `-EINVAL`.
Fixes #19021.
Lennart Poettering [Tue, 16 Mar 2021 20:29:06 +0000 (21:29 +0100)]
Merge pull request #19009 from poettering/one-more-cname-fix
resolved: more CNAME redirect fixes
Lennart Poettering [Tue, 16 Mar 2021 20:28:21 +0000 (21:28 +0100)]
Merge pull request #19022 from poettering/journal-dont-lose-facility
journald: don't lose facility of log streams on journald restart
Lennart Poettering [Tue, 16 Mar 2021 15:09:47 +0000 (16:09 +0100)]
journald: restore syslog priority *with* facility bits for stream connections when restarting journald
Fixes: #19019
Lennart Poettering [Tue, 16 Mar 2021 15:07:42 +0000 (16:07 +0100)]
journald: use log_warning_errno() where appropriate
Yu Watanabe [Mon, 8 Mar 2021 06:39:53 +0000 (15:39 +0900)]
sd-event: re-check new epoll events when a child event is queued
Previously, when a process outputs something and exit just after
epoll_wait() but before process_child(), then the IO event is ignored
even if the IO event has higher priority. See #18190.
This can be solved by checking epoll event again after process_child().
However, there exists a possibility that another process outputs and
exits just after process_child() but before the second epoll_wait().
When the IO event has lower priority than the child event, still IO
event is processed.
So, this makes new epoll events and child events are checked in a loop
until no new event is detected. To prevent an infinite loop, the number
of maximum trial is set to 10.
Fixes #18190.
Franck Bui [Mon, 15 Mar 2021 08:43:42 +0000 (09:43 +0100)]
meson.build: make xinitrcdir configurable
SUSE uses a different xinitrcdir ("/usr/etc/X11/xinit/xinitrc.d").
simmon [Tue, 16 Mar 2021 07:01:48 +0000 (08:01 +0100)]
po: Translated using Weblate (Korean)
Currently translated at 100.0% (189 of 189 strings)
Co-authored-by: simmon <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main
Lennart Poettering [Mon, 15 Mar 2021 22:26:46 +0000 (23:26 +0100)]
resolved: don't flush answer RRs on CNAME redirect too early
When doing a CNAME/DNAME redirect let's first check if the answer we
already have fully answers the redirected question already. If so, let's
use that. If not, let's properly restart things.
This simply removes one call to dns_answer_reset() that was placed too
early: instead of resetting when we detect a CNAME/DNAME redirect, do so
only after checking if the answer we already have doesn't match the
reply, and then decide to *actually* follow it. Or in other words: rely
on the dns_answer_reset() call in dns_query_go() which we'll call to
actually begin with the redirected question.
This fixes an optimization path which was broken back in
7820b320eaa608748f66f8105621640cf80e483a.
(This doesn't really matter as much as one might think, since our cache
stepped in anyway and answered the questions before going back to the
network. However, this adds noise if RRs with very short TTLs are cached
– which some CDNs do – and is of course relavant when people turn off
the local cache.)
Lennart Poettering [Mon, 15 Mar 2021 21:15:18 +0000 (22:15 +0100)]
resolved: match CNAME replies to right question
Previously by mistake we'd always match every single reply we get in a
CNAME chain to the original question from the stub client. That's
broken, we need to test it against the CNAME query we are currently
looking at.
The effect of this incorrect matching was that we'd assign the RRs to
the wrong section since we'd assume they'd be auxiliary answers instead
of primary answers.
Fixes: #18972
Lennart Poettering [Mon, 15 Mar 2021 21:15:06 +0000 (22:15 +0100)]
resolved: add helper for dumping DnsQuestion, similar to what we have for DnsAnswer
Lennart Poettering [Mon, 15 Mar 2021 21:14:43 +0000 (22:14 +0100)]
resolved: show TTLs in answer dump
Lennart Poettering [Mon, 15 Mar 2021 20:36:42 +0000 (21:36 +0100)]
resolved: use DNS_ANSWER_MASK_SECTIONS where appropriate
Lennart Poettering [Mon, 15 Mar 2021 20:18:52 +0000 (21:18 +0100)]
resolved: let's tweak how we calculate TTL left
When responding from DNS cache, let's slightly tweak how the TTL is
lowered: as before let's round down when converting from our internal µs
to the external seconds. (This is preferable, since records should
better be cached too short instead of too long.) Let's avoid rounding
down to zero though, since that has special semantics in many cases (in
particular mDNS). Let's just use 1s in that case.
Lennart Poettering [Mon, 15 Mar 2021 20:18:32 +0000 (21:18 +0100)]
resolved: take shortest TTL of all of RRs in answer as cache lifetime
We nowadays cache full answer RRset combinations instead of just the
exact matching rrset. This means we should not cache RRs that are not
immediate answers to our question for longer then their own RRs. Or in
other words: let's determine the shortest TTL of all RRs in the whole
answer, and use that as cache lifetime.
Lennart Poettering [Mon, 15 Mar 2021 20:15:30 +0000 (21:15 +0100)]
resolved: drop unnecessary local variable
Lennart Poettering [Mon, 15 Mar 2021 19:48:35 +0000 (20:48 +0100)]
resolved: fix indentation
Lennart Poettering [Mon, 15 Mar 2021 19:48:18 +0000 (20:48 +0100)]
resolved: use dns_answer_isempty() where appropriate
Lennart Poettering [Mon, 15 Mar 2021 19:47:53 +0000 (20:47 +0100)]
resolved: rebreak a few comments
Lennart Poettering [Mon, 15 Mar 2021 19:47:28 +0000 (20:47 +0100)]
resolved: add new helper dns_answer_min_ttl()
Luca Boccassi [Sun, 14 Mar 2021 12:36:15 +0000 (12:36 +0000)]
man: specify that ProtectProc= does not work with root/cap_sys_ptrace
When using hidepid=invisible on procfs, the kernel will check if the
gid of the process trying to access /proc is the same as the gid of
the process that mounted the /proc instance, or if it has the ptrace
capability:
https://github.com/torvalds/linux/blob/v5.10/fs/proc/base.c#L723
https://github.com/torvalds/linux/blob/v5.10/fs/proc/root.c#L155
Given we set up the /proc instance as root for system services,
The same restriction applies to CAP_SYS_PTRACE, if a process runs with
it then hidepid=invisible has no effect.
ProtectProc effectively can only be used with User= or DynamicUser=yes,
without CAP_SYS_PTRACE.
Update the documentation to explicitly state these limitations.
Fixes #18997
Yu Watanabe [Sat, 13 Mar 2021 10:56:30 +0000 (19:56 +0900)]
man: DNS/NTP servers received from DHCP server are concatenated with the statically configured ones
Prompted by #9473.
Luca Boccassi [Mon, 15 Mar 2021 14:31:48 +0000 (14:31 +0000)]
Merge pull request #18984 from poettering/event-test-timeout
sd-event: add test for timeout parameter of sd_event_wait()
Daan De Meyer [Fri, 12 Mar 2021 22:09:44 +0000 (22:09 +0000)]
boot: Move console declarations to missing_efi.h
These were added to eficonex.h in gnu-efi 3.0.13. Let's move them
to missing_efi.h behind an appropriate guard to fix the build with
recent versions of gnu-efi.
Yu Watanabe [Sat, 13 Mar 2021 11:07:48 +0000 (20:07 +0900)]
fstab-util: fix typo in comment
Kevin Backhouse [Fri, 12 Mar 2021 17:00:56 +0000 (18:00 +0100)]
ask-password-api: fix error handling on invalid unicode character
The integer overflow happens when utf8_encoded_valid_unichar() returns an error
code. The error code is a negative number: -22. This overflows when it is
assigned to `z` (type `size_t`). This can cause an infinite loop if the value
of `q` is 22 or larger.
To reproduce the bug, you need to run `systemd-ask-password` and enter an
invalid unicode character, followed by a backspace character.
GHSL-2021-052
Lennart Poettering [Fri, 12 Mar 2021 16:55:52 +0000 (17:55 +0100)]
sd-event: fix error handling
Noticed by @keszybz, see #18973
Lennart Poettering [Fri, 12 Mar 2021 16:54:12 +0000 (17:54 +0100)]
sd-event: add a simple test for checking the timeout parameter of sd_event_wait()
Related to: #18973
Luca Boccassi [Fri, 12 Mar 2021 14:54:12 +0000 (14:54 +0000)]
Merge pull request #18978 from keszybz/man-rc.local
Suggest network-online.target for rc.local
Yu Watanabe [Fri, 12 Mar 2021 10:45:17 +0000 (19:45 +0900)]
Merge pull request #18979 from keszybz/man-page-links
Man page links
Zbigniew Jędrzejewski-Szmek [Fri, 12 Mar 2021 08:04:30 +0000 (09:04 +0100)]
man: mention network-online.target in discussion of rc.local
Replacement for #18853.
Zbigniew Jędrzejewski-Szmek [Fri, 12 Mar 2021 09:57:59 +0000 (10:57 +0100)]
man: fix html links to two external man pages
Zbigniew Jędrzejewski-Szmek [Fri, 12 Mar 2021 09:55:10 +0000 (10:55 +0100)]
man: sd_bus_message_reply()→sd_bus_message_send()
Fixup for
6c41cf445912c12e14b1e94414a0fce1fa060ac2.
Zbigniew Jędrzejewski-Szmek [Fri, 12 Mar 2021 07:53:32 +0000 (08:53 +0100)]
man: also refname rc-local.service to the generator man page
This makes it easier to find for users.
ulf-f [Thu, 11 Mar 2021 18:18:14 +0000 (19:18 +0100)]
Update resolvectl.xml
fixed typo of filename
Frantisek Sumsal [Thu, 11 Mar 2021 16:25:55 +0000 (17:25 +0100)]
Revert "sd-event: re-check new epoll events when a child event is queued"
This reverts commit
84e998c112ff18bba786660bd6c1f96f62a77ffe.
Temporarily revert this commit, since it breaks CI.
Lennart Poettering [Thu, 11 Mar 2021 15:36:38 +0000 (16:36 +0100)]
Merge pull request #18922 from yuwata/sd-event-fix-issue-18190
sd-event: re-check new epoll events when a child event is queued
Yu Watanabe [Mon, 8 Mar 2021 06:39:53 +0000 (15:39 +0900)]
sd-event: re-check new epoll events when a child event is queued
Previously, when a process outputs something and exit just after
epoll_wait() but before process_child(), then the IO event is ignored
even if the IO event has higher priority. See #18190.
This can be solved by checking epoll event again after process_child().
However, there exists a possibility that another process outputs and
exits just after process_child() but before the second epoll_wait().
When the IO event has lower priority than the child event, still IO
event is processed.
So, this makes new epoll events and child events are checked in a loop
until no new event is detected. To prevent an infinite loop, the number
of maximum trial is set to 10.
Fixes #18190.
Yu Watanabe [Thu, 11 Mar 2021 05:19:50 +0000 (14:19 +0900)]
test: add log messages
Zbigniew Jędrzejewski-Szmek [Thu, 11 Mar 2021 11:54:36 +0000 (12:54 +0100)]
NEWS: update contributors list for v248-rc3
Zbigniew Jędrzejewski-Szmek [Thu, 11 Mar 2021 13:46:16 +0000 (14:46 +0100)]
Merge pull request #18915 from keszybz/reexec-bug
Fix crash during daemon-reexec with systemd-oomd running
Zbigniew Jędrzejewski-Szmek [Thu, 11 Mar 2021 13:45:11 +0000 (14:45 +0100)]
Merge pull request #18955 from keszybz/fstab-escaping
Fix handling of escaped characters in fstab
Zbigniew Jędrzejewski-Szmek [Wed, 10 Mar 2021 09:00:04 +0000 (10:00 +0100)]
basic/group-util: optimize alloca use
Follow-up for
0fa7b50053.
Zbigniew Jędrzejewski-Szmek [Tue, 9 Mar 2021 17:41:21 +0000 (18:41 +0100)]
docs: more markup
Frantisek Sumsal [Thu, 11 Mar 2021 11:49:00 +0000 (12:49 +0100)]
repart: fix the loop dev support check
Since
f17bdf8264e231fa31c769bff2475ef698487d0b the test-repart was
effectively disabled, since `/dev/loop-control` is a character special
file, whereas `-f` works only on regular files. Even though we could use
`-c` to check specifically for character special files, let's use `-e`
just in case.
Zbigniew Jędrzejewski-Szmek [Thu, 11 Mar 2021 13:42:17 +0000 (14:42 +0100)]
Merge pull request #18962 from poettering/dissect-fixes
three image dissection fixes
Michal Sekletar [Tue, 9 Mar 2021 16:22:32 +0000 (17:22 +0100)]
install: refactor find_symlinks() and don't search for symlinks recursively
After all we are only interested in symlinks either in top-level config
directory or in .wants and .requires sub-directories.
As a bonus this should speed up ListUnitFiles() roughly 3-4x on systems
with a lot of units that use drop-ins (e.g. SSH jump hosts with a lot of
user session scopes).
Lennart Poettering [Thu, 11 Mar 2021 09:00:17 +0000 (10:00 +0100)]
man: shorten list of partition types a bit
Tables with only one column aren't really tables, they are lists. And if
each cell only consists of a single word, they are probably better
written in a single line. Hence, shorten the man page a bit, and list
boot loader spec partition types in a simple sentence.
Also, drop "root-secondary" from the list. When dissecting images we'll
upgrade "root-secondary" to "root" if we mount it, and do so only if
"root" doesn't exist. Hence never mention "root-secondary" as we never
will mount a partition under that id.
Lennart Poettering [Tue, 9 Mar 2021 21:01:41 +0000 (22:01 +0100)]
dissect: fix trivial typo
Lennart Poettering [Thu, 11 Mar 2021 10:44:03 +0000 (11:44 +0100)]
dissect-image: fix volatile images
This makes sure nspawn's --volatile=yes switch works again: there we
have a read-only image that is overmounted by a tmpfs (with the
exception of /usr). This we need to mkdir all mount points even though
the image is read-only.
Hence, let's drop the optimizatio of avoiding mkdir() on images that are
read-only, it's wrong and misleading here, since the image itself might
be read-only but our mounts are not.
Lennart Poettering [Tue, 9 Mar 2021 21:03:00 +0000 (22:03 +0100)]
dissect-image: clean up meaning of DISSECT_IMAGE_MKDIR
Previously handling of DISSECT_IMAGE_MKDIR was pretty weird and broken:
it would control both if we create the top-level mount point when
mounting an image, and the inner mount points for images that consist of
multiple file systems. However, the latter is redundant, since
1f0f82f1311e4c52152b8e2b6f266258709c137d does this too, a few lines
further up – unconditionally!
Hence, let's make the meaning of DISSECT_IMAGE_MKDIR more strict: it
shall be only about the top-level mount point, not about the inner ones
(where we'll continue to create what is missing alwayway). Having a
separate flag for the top-level mount point is relevant, since the mount
point dir created by it will remain on the host fs – unlike the
directories we create inside the image, which will stay within the
image.
This slightly change of meaning is actually inline with what the flag is
actually used for and documented in systemd-dissect.
Zbigniew Jędrzejewski-Szmek [Thu, 11 Mar 2021 10:10:32 +0000 (11:10 +0100)]
fstab-generator: get rid of fstab_extract_values()
This was a parallel implementation of option parsing that didn't
support escaping of separators. Let's port this over to the common code.
Fixes #18952.
Zbigniew Jędrzejewski-Szmek [Thu, 11 Mar 2021 09:37:36 +0000 (10:37 +0100)]
shared/fstab-util: teach fstab_filter_options() a mode where all values are returned
Apart from tests, the new argument isn't used anywhere, so there should be no
functional change. Note that the two arms of the big conditional are switched, so the
diff is artificially inflated. The actual code change is rather small. I dropped the
path which extracts ret_value manually, because it wasn't supporting unescaping of the
escape character properly.
Zbigniew Jędrzejewski-Szmek [Wed, 10 Mar 2021 15:53:38 +0000 (16:53 +0100)]
shared/fstab-util: pass through the escape character
… when not used to escape the separator (,) or the escape character (\).
This mostly restores behaviour from before
0645b83a40d1c782f173c4d8440ab2fc82a75006,
but still allows "," to be escaped.
Partially fixes #18952.
Zbigniew Jędrzejewski-Szmek [Wed, 10 Mar 2021 14:39:47 +0000 (15:39 +0100)]
basic/extract-word: rename flag
The flag enables "relaxed mode" for all kinds of unescaping, not just c-unescaping.
Zbigniew Jędrzejewski-Szmek [Wed, 10 Mar 2021 14:17:56 +0000 (15:17 +0100)]
basic/extract-word: allow escape character to be escaped
With EXTRACT_UNESCAPE_SEPARATORS, backslash is used to escape the separator.
But it wasn't possible to insert the backslash itself. Let's allow this and
add test.
Zbigniew Jędrzejewski-Szmek [Wed, 10 Mar 2021 13:23:23 +0000 (14:23 +0100)]
basic/extract_word: try to explain what the various options do
A test for stripping of escaped backslashes without any flags was explicitly
added back in
4034a06ddb82ec9868cd52496fef2f5faa25575f. So it seems to be on
purpose, though I would say that this is at least surprising and hence deserves
a comment.
In test-extract-word, add tests for standalone EXTRACT_UNESCAPE_SEPARATORS.
Only behaviour combined with EXTRACT_CUNESCAPE was tested.
Zbigniew Jędrzejewski-Szmek [Wed, 10 Mar 2021 12:35:26 +0000 (13:35 +0100)]
shared/fstab-util: immediately drop empty options again
In the conversion from strv_split() to strv_split_full() done in
7bb553bb98a57b4e03804f8192bdc5a534325582, EXTRACT_DONT_COALESCE_SEPARATORS was
added. I think this was just by mistake… We never look for "empty options", so
whether we immediately ignore the extra separator or store the empty string in
strv, should make no difference.
Zbigniew Jędrzejewski-Szmek [Wed, 10 Mar 2021 12:20:47 +0000 (13:20 +0100)]
generators: warn but ignore failure to write timeouts
When we failed to split the options (because of disallowed quoting syntax, which
might be a bug in its own), we would silently fail. Instead, let's emit a warning.
Since we ignore the value if we cannot parse it anyway, let's ignore this error
too.
Lennart Poettering [Wed, 10 Mar 2021 20:54:59 +0000 (21:54 +0100)]
coredumpctl: fflush() stdout before invoking gdb
Fixes: #18936
Zbigniew Jędrzejewski-Szmek [Tue, 9 Mar 2021 18:06:18 +0000 (19:06 +0100)]
udev: add default group for sgx enclave access
Closes #18669.
This creates a "well known" for sgx_enclave ownership. By doing this here we
avoid the risk that various projects making use of the device will provide
similar-but-slightly-incompatible installation instructions, in particular
using different group names.
ACLs are actually a better approach to grant access to users, but not in all
cases, so we want to provide a standard group anyway.
Mode is 0o660, not 0o666 because this is very new code and distributions are
likely to not want to give full access to all users. This might change in the
future, but being conservative is a good default in the beginning.
Rules for /dev/sgx_provision will be provided by libsg-ae-pce:
https://github.com/intel/linux-sgx/issues/678.
Lennart Poettering [Wed, 10 Mar 2021 21:36:20 +0000 (22:36 +0100)]
update TODO
Frantisek Sumsal [Wed, 10 Mar 2021 15:41:35 +0000 (16:41 +0100)]
coredump: omit coredump info when -q is used with the `debug` verb
Skip printing the coredump info table when using the `debug` verb in
combination with the `-q/--quiet` option. Useful when trying to gather
coredump info non-interactively via scripted gdb commands.
Fixes: systemd/systemd#18935
Zbigniew Jędrzejewski-Szmek [Wed, 10 Mar 2021 10:49:02 +0000 (11:49 +0100)]
fstab-generator: do not propagate error if we fail to canonicalize
r is used for the return value of the function, so we shouldn't
use it a non-fatal check.
Frantisek Sumsal [Wed, 10 Mar 2021 11:30:04 +0000 (12:30 +0100)]
test: fix permissions of the ASan udev workaround
otherwise udev complains about the file being world-writable:
systemd-udevd[228]: Configuration file /etc/udev/rules.d/00-set-LD_PRELOAD.rules is marked world-writable. Please remove world writability permission bits. Proceeding anyway.
Fixes: systemd/systemd-centos-ci#354
Zbigniew Jędrzejewski-Szmek [Wed, 10 Mar 2021 09:17:23 +0000 (10:17 +0100)]
Revert "udev: do not execute hwdb builtin import twice or thrice"
This reverts commit
876c75fe870846b09b54423a6b719d80bc879b27.
The patch seems to cause usb devices to get some attributes set from the parent
PCI device. 'hwdb' builtin has support for breaking iteration upwards on usb
devices. But when '--subsystem=foo' is specified, iteration is continued. I'm
sure it *could* be figured out, but it seems hard to get all the combinations
correct. So let's revert to functional status quo ante, even if does the lookup
more than once unnecessarily.
Fixes #18125.
Frantisek Sumsal [Tue, 9 Mar 2021 21:20:39 +0000 (22:20 +0100)]
test: disable nss-systemd for TEST-22 under ASan
When running TEST-22 under ASan, there's a chain of events which causes
`stat` to output an extraneous ASan error message, causing following
fail:
```
+ test -d /tmp/d/1
++ stat -c %U:%G:%a /tmp/d/1
==82==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
+ test = daemon:daemon:755
.//usr/lib/systemd/tests/testdata/units/testsuite-22.02.sh: line 24: test: =: unary operator expected
```
This is caused by `stat` calling nss which in Arch's configuration calls
the nss-systemd module, that pulls in libasan which causes the $LD_PRELOAD
error message, since `stat` is an uninstrumented binary.
The $LD_PRELOAD variable is explicitly unset for all testsuite-* services
since it causes various issues when calling uninstrumented libraries, so
setting it globally is not an option. Another option would be to set
$LD_PRELOAD for each `stat` call, but that would unnecessarily clutter
the test code.
Zbigniew Jędrzejewski-Szmek [Wed, 10 Mar 2021 08:41:40 +0000 (09:41 +0100)]
Merge pull request #18553 from Werkov/cgroup-user-instance-controllers
Make (user) instance aware of delegated cgroup controllers
Zbigniew Jędrzejewski-Szmek [Wed, 10 Mar 2021 08:18:06 +0000 (09:18 +0100)]
Merge pull request #18942 from keszybz/sd-netlink-prettification
sd-nelink prettification
Lennart Poettering [Tue, 9 Mar 2021 19:43:02 +0000 (20:43 +0100)]
socket-util: refuse ifnames with embedded '%' as invalid
So Linux has this (insane — in my opinion) "feature" that if you name a
network interface "foo%d" then it will automatically look for the
interface starting with "foo…" with the lowest number that is not used
yet and allocates that.
We should never clash with this "magic" handling of ifnames, hence
refuse this, since otherwise we never know what the name is we end up
with.
We should probably switch things from a deny list to an allow list
sooner or later and be much stricter. Since the kernel directly enforces
only very few rules on the names, we'd need to do some research what is
safe and what is not first, though.
Lennart Poettering [Tue, 9 Mar 2021 22:20:53 +0000 (23:20 +0100)]
update TODO
Zbigniew Jędrzejewski-Szmek [Tue, 9 Mar 2021 16:26:01 +0000 (17:26 +0100)]
sd-netlink: shorten things a bit
Zbigniew Jędrzejewski-Szmek [Tue, 9 Mar 2021 16:24:57 +0000 (17:24 +0100)]
sd-netlink: use setsockopt_int() also for NETLINK_ADD/DROP_MEMBERSHIP
We use 'unsigned' as the type, but netlink(7) says the type is 'int'.
It doesn't really matter, since they are both the same size. Let's use
our helper to shorten the code a bit.
Zbigniew Jędrzejewski-Szmek [Tue, 9 Mar 2021 16:13:20 +0000 (17:13 +0100)]
sd-netlink: use structured initialization
The casts look somewhat ugly and type-unsafe, but they are equivalent
to what was there before (we initialized a variable from a void*).
Lennart Poettering [Mon, 8 Mar 2021 19:41:34 +0000 (20:41 +0100)]
fs-util: port symlink_idempotent() to path_extract_directory()
Zbigniew Jędrzejewski-Szmek [Tue, 9 Mar 2021 08:03:58 +0000 (09:03 +0100)]
logind: add …WithFlags methods to policy
Without this, privilege escalation through polkit does not work, because all
methods fail with permission errors.
Forgotten in
8885fed4e3a52cf1bf105e42043203c485ed9d92.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=
1933335.