1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-12 13:18:14 +03:00
Commit Graph

50246 Commits

Author SHA1 Message Date
Lennart Poettering
7e7b0e2198 update TODO 2021-03-22 19:07:34 +01:00
Lennart Poettering
1a71fe4ee5 resolved: don't accept responses to query unless they completely answer our questions
When we checking if the responses we collected for a DnsQuery are
sufficient to complete it we previously only check if one of the
collected response RRs matches at least one of the question RR keys.

This changes the logic to require that there must be at least one
response RR matched *each* of the question RR keys before considering
the answer complete.

Otherwise we might end up accepting an A reply as complete answer for an
A/AAAA query and vice versa, but we want to make sure we wait until we
get a reply on both types before returning this to the user in all
cases.

This has been broken for basically forever, but didn't surface until
b1eea703e0 since until then we'd basically
ignore the auxiliary RRs included in CNAME/DNAME replies. Once that
commit was made we'd start using the auxiliary RRs included in
CNAME/DNAME replies but those typically included only A or only AAAA
which we then took for complete.

Fixe: #19049
2021-03-22 18:40:06 +01:00
Lennart Poettering
4cba52cc7a resolved: propagate correct error variable 2021-03-22 18:27:36 +01:00
Sergey Bugaev
fbdacd7268 homework: use FORK_CLOSE_ALL_FDS in a few more places
And make sure to reopen the log appropriately.
2021-03-22 19:34:07 +03:00
Sergey Bugaev
7e0ed2e9a2 tree-wide: reopen log after fork when needed
This follows up on 0b1f3c768c, adding more places
where we should reopen the log after forking with FORK_CLOSE_ALL_FDS.

When immediately calling exec in the child, prefer to explicitly reopen the log
after exec fails. In other cases, just use FORK_REOPEN_LOG.
2021-03-22 19:34:07 +03:00
Sergey Bugaev
0e557eef37 log: protect errno in log_open()
Commit 0b1f3c768c has introduced log_open()
calls after exec fails post-fork. However, the log_open() call itself could
change the value of errno, which, for me, manifested in:

$ coredumpctl gdb
...
Failed to invoke gdb: Success

Fix this by using PROTECT_ERRNO in log_open().
2021-03-22 19:34:03 +03:00
Yu Watanabe
dcb6061e1c meson: fix warning about comparison between different types
Follow-up for e39288193f.
2021-03-22 14:40:46 +01:00
Zbigniew Jędrzejewski-Szmek
169615c9a8 shared/calendarspec: abort calculation after 1000 iterations
We have a bug where we seem to enter an infinite loop when running in the
Europe/Dublin timezone. The timezone is "special" because it has negative SAVE
values. The handling of this should obviously be fixed, but let's use a
belt-and-suspenders approach, and gracefully fail if we fail to find an answer
within a specific number of attempts. The code in this function is rather
complex, and it's hard to rule out another bug in the future.
2021-03-22 13:44:57 +01:00
Antonio Terceiro
17e9000164 logs-show: add missing newline in warning message 2021-03-21 17:52:07 +00:00
Yu Watanabe
fcc3c20ca3 meson: fix build error of test-dnssec-complex
Fixes #19065.
2021-03-21 13:18:44 +01:00
tpgxyz
e39288193f systemd-boot: LLVM/lld does not support PE/COFF relocations. Bail out with an error message 2021-03-19 19:42:47 +00:00
Lennart Poettering
c68fc3514d blockdev-util: fix access to possibly invalidated dirent struct
Let's copy out the string we need from the dirent, there's no reason to
believe the dirent struct might live for longer than one loop iteration.
2021-03-19 18:13:17 +01:00
Lennart Poettering
f9b3afae96 repart: make sure to grow partition table after growing backing loopback file
This fixes the --size= switch, i.e. where we grow a disk image: after
growing it we need to expand the partition table so that its idea of the
the medium size matches the new reality. Otherwise our disk size
calculations in the subsequent steps might still use the original
ungrown size.

(This used to work, I guess this was borked when libfdisk learnt the
concept of "minimized" partition tables)
2021-03-19 18:11:26 +01:00
Michael Gisbers
6d18c13e79
correct incorrect command in NEWS (#19048)
* for /dev/vsock a file permission of 0o666 was mentioned but 0666 is probably better understood, so let's use that
* correct non existing command 'ip dev'
2021-03-19 11:38:53 +01:00
Sam Lunt
6f50c94dfd Wrong index in error message 2021-03-19 09:53:25 +00:00
Yu Watanabe
5cdb3f70eb udev: do not try to assign invalid ifname
Fixes #19038.
2021-03-19 09:52:21 +00:00
Lennart Poettering
7f966edbda homepage: fix year in footer to 2021
(And while we are at it, let's fix the "Sources" link in the footer to point to the right git repo subdir)
2021-03-18 23:31:55 +01:00
Luca Boccassi
dc4c1d4434
Merge pull request #19030 from dtardon/rhel9-covscan
a bunch of small fixes and clenups based on initial RHEL-9 covscan run
2021-03-18 16:28:46 +00:00
Luca Boccassi
12854a6ed5
Merge pull request #19036 from mrc0mmand/cocci-fixes
tree-wide: coccinelle fixes
2021-03-18 14:26:04 +00:00
David Tardon
eba1eb9066 resolved-dns-rr: drop unneeded braces 2021-03-18 13:19:13 +01:00
David Tardon
037e5b1547 resolved-dns-rr: use already existing variable 2021-03-18 13:19:13 +01:00
David Tardon
516a00e9cf resolved-dns-rr: avoid unnecessary reassignment 2021-03-18 13:19:00 +01:00
David Tardon
bc83340176 resolved-dns-rr: don't leak s if base64_append fails 2021-03-18 13:13:04 +01:00
Frantisek Sumsal
ca21d59a3f coccinelle: filter out a couple of 'false-positive' transformations
* flag-set.cocci: perform the transformation only if the second
    argument is a constant
  * sd-journal/lookup3.c: skip the cocci completely for this file, since
    it's not "ours"
  * strjoina.cocci: skip the transformation on the "test_strjoina" test,
    since it intentionally tests the "incorrect" expression we're trying to
    transform (the same thing was already done in strjoin.cocci)
2021-03-18 11:59:53 +01:00
Frantisek Sumsal
57ac6959f5 tree-wide: coccinelle fixes
Another batch of fixes (mostly) generated by Coccinelle.
2021-03-18 11:59:31 +01:00
Ulrich Ölmann
2c0c1b095c shutdown: fix typo 2021-03-18 09:43:08 +00:00
David Tardon
8f3e1b9d01 systemctl-edit: don't leak the old value of contents 2021-03-18 09:41:49 +01:00
David Tardon
c4a2d475f1 journal-upload: use _cleanup_ for curl_slist 2021-03-18 09:41:49 +01:00
David Tardon
3851069709 journal-upload: make the curl_slist cleanup actually work
If h is NULL, it is pointless to call curl_slist_free_all() on it...
2021-03-18 09:41:49 +01:00
David Tardon
a6f575a1e8 journal-upload: cleanup CURL* on error 2021-03-18 09:41:49 +01:00
David Tardon
c60d95ca4f journal-gatewayd: use automatic cleanup 2021-03-18 09:41:46 +01:00
Lennart Poettering
22bf8ff8e0
Merge pull request #19011 from anitazha/pgscanrate
oomd: update pressure based kills to use pgscan rate
2021-03-17 23:26:49 +01:00
Lennart Poettering
52b501c976
Merge pull request #19034 from poettering/read-virtual-file-fix
read_virtual_file() tweaks
2021-03-17 22:45:16 +01:00
Anita Zhang
77b04c0a6c 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
2021-03-17 13:07:11 -07:00
Lennart Poettering
b7beefbdde
Merge pull request #19031 from poettering/hwdb-248
prepare 248-rc4
2021-03-17 21:03:02 +01:00
Luca Boccassi
18da936481 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.
2021-03-17 18:56:33 +00:00
Lennart Poettering
c5384931b7 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.
2021-03-17 18:48:01 +01:00
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