1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-10 01:17:44 +03:00
Commit Graph

50259 Commits

Author SHA1 Message Date
Lennart Poettering
b235b03138 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.
2021-03-17 18:47:56 +01:00
Lennart Poettering
be81e45c74 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.)
2021-03-17 18:44:51 +01:00
Lennart Poettering
627055ce9a 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.
2021-03-17 18:43:42 +01:00
Anita Zhang
bb08124092 oomctl: show last_pgscan 2021-03-17 10:17:05 -07:00
Anita Zhang
88e47952af 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.
2021-03-17 10:17:03 -07:00
Lennart Poettering
04820600e7 update TODO 2021-03-17 18:13:51 +01:00
Lennart Poettering
d94d261c56 update NEWS for rc4 2021-03-17 16:53:18 +01:00
Lennart Poettering
1ab4edae12 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.
2021-03-17 16:53:14 +01:00
Lennart Poettering
264f1e5c3d mailmap: merge Weblate bot commiter into one 2021-03-17 16:53:10 +01:00
Lennart Poettering
cd10a4f5ec meson.build: bump version of libudev
It didn't receive new API calls, bit it was changed, hence bump the
version accordingly.
2021-03-17 16:53:01 +01:00
Lennart Poettering
4b7a051d92 hwdb: ninja update-hwdb 2021-03-17 16:52:57 +01:00
Lennart Poettering
6dca7954e3 hwdb: ninja update-hwdb-autosuspend 2021-03-17 16:52:33 +01:00
Luca Boccassi
acaf21e24d doc/RELEASE.md: document hwdb update step 2021-03-17 16:42:38 +01:00
igo95862
ca1eacd8e0 man: Specify that only d-bus methods can be answered async
Not properties.
2021-03-17 16:15:56 +01:00
Dan Sanders
5e23c2f42f hwdb: unifying receiver match keys for Logitech MX Ergo 2021-03-17 15:44:37 +01:00
Mike Gilbert
2156061fb3 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
2021-03-17 15:42:22 +01:00
Anita Zhang
91cbb4bdd6 oomd: update memory pressure candidates every interval 2021-03-16 23:54:14 -07:00
Anita Zhang
b037a6da31 oomd: new helper oomd_update_cgroup_contexts_between_hashmaps 2021-03-16 18:10:57 -07:00
Yu Watanabe
fa92d38428 dhcp6: fix wrong length for IA_PD dhcp6 option
Fixes an issue introduced by 73b49d433c.

When PrefixDelegationHint= is not set, dhcp6_option_append_pd() sets
wrong length for IA_PD option, as `r` is `-EINVAL`.

Fixes #19021.
2021-03-16 21:29:49 +01:00
Lennart Poettering
69bedd07c3
Merge pull request #19009 from poettering/one-more-cname-fix
resolved: more CNAME redirect fixes
2021-03-16 21:29:06 +01:00
Lennart Poettering
1a2c2e1222
Merge pull request #19022 from poettering/journal-dont-lose-facility
journald: don't lose facility of log streams on journald restart
2021-03-16 21:28:21 +01:00
Lennart Poettering
d977ef2542 journald: restore syslog priority *with* facility bits for stream connections when restarting journald
Fixes: #19019
2021-03-16 16:09:47 +01:00
Lennart Poettering
d267ac6e64 journald: use log_warning_errno() where appropriate 2021-03-16 16:07:42 +01:00
Yu Watanabe
efd3be9de1 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.
2021-03-16 13:35:20 +01:00
Franck Bui
e62636741c meson.build: make xinitrcdir configurable
SUSE uses a different xinitrcdir ("/usr/etc/X11/xinit/xinitrc.d").
2021-03-16 13:27:09 +01:00
simmon
4dbcd443d4 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
2021-03-16 16:14:30 +09:00
Lennart Poettering
b1eea703e0 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 7820b320ea.

(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.)
2021-03-15 23:55:07 +01:00
Lennart Poettering
a7c0291c10 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
2021-03-15 23:54:53 +01:00
Lennart Poettering
1414b67e0d resolved: add helper for dumping DnsQuestion, similar to what we have for DnsAnswer 2021-03-15 23:41:25 +01:00
Lennart Poettering
567aa5c87b resolved: show TTLs in answer dump 2021-03-15 23:41:25 +01:00
Lennart Poettering
c4d98c3acc resolved: use DNS_ANSWER_MASK_SECTIONS where appropriate 2021-03-15 23:41:25 +01:00
Lennart Poettering
a1acc6e332 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.
2021-03-15 23:41:25 +01:00
Lennart Poettering
b974211acb 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.
2021-03-15 22:57:40 +01:00
Lennart Poettering
f6d80c361d resolved: drop unnecessary local variable 2021-03-15 21:21:43 +01:00
Lennart Poettering
b12058e8f9 resolved: fix indentation 2021-03-15 21:21:42 +01:00
Lennart Poettering
77db3caee3 resolved: use dns_answer_isempty() where appropriate 2021-03-15 21:21:42 +01:00
Lennart Poettering
3b7006cb44 resolved: rebreak a few comments 2021-03-15 21:21:42 +01:00
Lennart Poettering
1499a0a99a resolved: add new helper dns_answer_min_ttl() 2021-03-15 21:21:37 +01:00
Luca Boccassi
301e7cd047 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
2021-03-15 16:53:16 +00:00
Yu Watanabe
b63dae3168 man: DNS/NTP servers received from DHCP server are concatenated with the statically configured ones
Prompted by #9473.
2021-03-15 14:48:47 +00:00
Luca Boccassi
65d325edb8
Merge pull request #18984 from poettering/event-test-timeout
sd-event: add test for timeout parameter of sd_event_wait()
2021-03-15 14:31:48 +00:00
Daan De Meyer
95ba433a5f 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.
2021-03-13 13:13:54 +00:00
Yu Watanabe
925bd4c24e fstab-util: fix typo in comment 2021-03-13 12:26:10 +01:00
Kevin Backhouse
37ca78a35c 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
2021-03-12 18:25:58 +01:00
Lennart Poettering
7cb45dbfa3 sd-event: fix error handling
Noticed by @keszybz, see #18973
2021-03-12 17:56:56 +01:00
Lennart Poettering
c14e57ba6b sd-event: add a simple test for checking the timeout parameter of sd_event_wait()
Related to: #18973
2021-03-12 17:56:33 +01:00
Luca Boccassi
495787b56c
Merge pull request #18978 from keszybz/man-rc.local
Suggest network-online.target for rc.local
2021-03-12 14:54:12 +00:00
Yu Watanabe
c99c197d07
Merge pull request #18979 from keszybz/man-page-links
Man page links
2021-03-12 19:45:17 +09:00
Zbigniew Jędrzejewski-Szmek
eb0845dfb8 man: mention network-online.target in discussion of rc.local
Replacement for #18853.
2021-03-12 11:22:58 +01:00
Zbigniew Jędrzejewski-Szmek
ba3dc45126 man: fix html links to two external man pages 2021-03-12 10:58:16 +01:00