1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00
Commit Graph

55813 Commits

Author SHA1 Message Date
Yu Watanabe
e135559d80 network: wireguard: also accept negative boolean values to disable adding routes
RouteTable=off was introduced to provide consistency with wg-quick
command. This makes the RouteTable= settings accepts other negative
boolean values.
2022-01-16 19:25:28 +09:00
Yu Watanabe
cfe1237f38 network: wireguard: do not add routes to AllowedIPs= by default
As setting such routes may break existing setups.

Closes #21964.
2022-01-16 19:18:23 +09:00
Luca Boccassi
8a592c6fc2
Merge pull request #22130 from keszybz/silence-gcc-warning-in-sd-device
Silence gcc warning in sd-device
2022-01-15 16:22:59 +00:00
Zbigniew Jędrzejewski-Szmek
e47a3af44e sd-device: drop unnecessary parenthesis 2022-01-15 13:38:49 +01:00
Zbigniew Jędrzejewski-Szmek
376ee2c312 sd-device: silence gcc warning with newest gcc 2022-01-15 13:38:30 +01:00
Daan De Meyer
8646b5d6e6 shared: Copy holes in sparse files in copy_bytes_full()
Previously, all holes in sparse files copied with copy_bytes_full()
would be expanded in the target file. Now, we correctly detect holes
in the input file and we replicate them in the target file.
2022-01-14 16:48:28 +00:00
Yu Watanabe
9e3e592946
Merge pull request #22098 from DaanDeMeyer/journal-corrupt-2
journal: Fixes for handling of corrupt entry objects
2022-01-14 21:23:32 +09:00
Yu Watanabe
ba3440b9ab
Merge pull request #22096 from keszybz/networkctl-bus-once
Open the bus once in networkctl
2022-01-14 21:21:08 +09:00
Daan De Meyer
8d801e35cb journal: Fix entry array iteration corruption checks
Previously, we'd try to handle corruption by bumping the index even
if it was an entry array object that was corrupted (which we can't
deal with).

Now, we only try to deal with corrupted entry objects by moving the
corruption handling into generic_array_get().

On top, we also add an additional check for -EADDRNOTAVAIL which can
also be caused by corrupted journal data.
2022-01-14 11:33:32 +00:00
Evgeny Vereshchagin
9e360c6bf1 ci: switch to requirements.txt in the unit tests workflow 2022-01-14 10:29:23 +00:00
Yu Watanabe
dc7e9c1bc4 meson: use the compiler command array as is
Also check if the flags used when building bpf are supported by clang.
2022-01-14 17:01:58 +09:00
Yu Watanabe
a6ac8b5a4d meson: check if clang supports bpf 2022-01-14 16:43:31 +09:00
Yu Watanabe
ea78d2fb11 meson: require bpftool version >= 5.6
Closes #22051.
2022-01-14 16:43:31 +09:00
Zbigniew Jędrzejewski-Szmek
100433e05a networkctl: use xsprintf a bit more 2022-01-14 16:24:27 +09:00
Zbigniew Jędrzejewski-Szmek
d821e40ca9 networkctl: open the bus just once
We'd connect to the bus twice: the first time to check networkd namespace,
and then the second time to do the deed we were asked to do. It's nicer
to open the bus just once, for efficience and also to avoid the open call
in all functions.

An ASSERT_PTR helper is added:
- sd_bus *bus = userdata;
  ...
- assert(bus);
+ sd_bus *bus = ASSERT_PTR(userdata);
  ...

It can be used in other place too, but I'm leaving that for a later
refactoring.
2022-01-14 16:24:04 +09:00
Benjamin Berg
048d469999 man: Add more details about desktop file processing
In particular, mention the contract the generator has with external
ExecCondition= binaries that may be provided by desktop environments.

But, also mention all the other relevant keys. In particular
X-systemd-skip= is important to be documented.
2022-01-14 16:20:45 +09:00
Evgeny Vereshchagin
007721e939 ci: turn meson warnings into errors 2022-01-14 01:53:37 +03:00
Luca Boccassi
e6d692ddfd
Merge pull request #22111 from medhefgo/boot-cleanup
boot: Cleanup
2022-01-13 22:50:52 +00:00
Yu Watanabe
902bbdc4b6 network: use scope link for direct unicast routes by default
Strictly speaking, this breaks the backward compatibility, but I guess
in most cases people already sets Scope=link for such routes.

This behavior matches with how 'ip route' command adds such route by
default.

Prompted by https://twitter.com/jplitza/status/1480500562391179270.
2022-01-13 22:46:52 +00:00
Luca Boccassi
fad7ad2b8b
Merge pull request #22106 from yuwata/dhcp6-broken-NTP
sd-dhcp6-client: handle broken NTP server option gracefully
2022-01-13 22:43:07 +00:00
Daan De Meyer
4d6455c075 journal: Don't discard -b arg when followed by -e
Allowing -e to be used to view the last logs of a previous boot seems
like a useful feature so let's not discard -b options anymore when
followed by -e.

Fixes #22107
2022-01-14 01:10:22 +09:00
Jan Janssen
2d1ac308c5 boot: Use FreePool from boot services directly
This should hopefully allow the compiler to optimize this a bit even
when gnu-efi is not compiled with LTO.
2022-01-13 14:30:51 +01:00
Jan Janssen
27c106bab8 boot: Add missing assert to file_read() 2022-01-13 14:30:51 +01:00
Jan Janssen
e1e086d1f7 boot: Use _cleanup_ in shim
Also, better be safe than sorry and check the return value.
2022-01-13 14:30:51 +01:00
Jan Janssen
acd28f3912 boot: Don't try to free loaded_image
EFI_LOADED_IMAGE is a protocol pointer and thus, we shouldn't try
to free it.
2022-01-13 14:29:46 +01:00
Jan Janssen
85eb489e23 boot: Use EFI_FILE* instead of EFI_FILE_HANDLE
They are both the same, but the former is shorter and also closer
to how file handles are represented in the UEFI spec.
2022-01-13 14:26:43 +01:00
Jan Janssen
41b74a18b2 boot: Fix invalid free
LocateDevicePath() advances the device path pointer, making it invalid
when freed.
2022-01-13 14:19:32 +01:00
Yu Watanabe
2ebb69bc09 boot: add missing error check
Follow-up for 661615a0af.

Fixes CID#1468973.
2022-01-13 14:17:15 +01:00
Evgeny Vereshchagin
4e1ab496ae {build|unit}-test: show meson-log.txt when meson fails
to make it easier to figure out why it fails.

For example in https://github.com/systemd/systemd/runs/4799774735?check_suite_focus=true
it failed with
```

meson.build:1003:8: ERROR: Command "/usr/bin/clang -print-targets" failed with status 1.

A full log can be found at /home/runner/work/systemd/systemd/build/meson-logs/meson-log.txt
Error: Process completed with exit code 1.
```
and it wasn't clear what exactly happened there.
2022-01-13 20:27:25 +09:00
Hugo Carvalho
d2ceeb624c po: Translated using Weblate (Portuguese)
Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: Hugo Carvalho <hugokarvalho@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/pt/
Translation: systemd/main
2022-01-13 20:24:05 +09:00
Yu Watanabe
95c514e9a5 test: add testcase for broken NTP server option
For issue #22099.
2022-01-13 20:21:40 +09:00
Yu Watanabe
37408dd264 test: voidify test functions
This also drops unnecessary arguments, and unbreak several lines.
2022-01-13 20:20:48 +09:00
Yu Watanabe
16de849fd8 sd-dhcp6-client: expose client_parse_message()
To introduce tests for the function in later commits.
2022-01-13 20:20:19 +09:00
Yu Watanabe
0ac9daa4a1 sd-dhcp6-client: ignore broken non-critical options
The commit b89a3758e9 made the validity
check of the received message stricter. E.g. if the client received a
message with broken NTP server option, then the entire message is
dropped.

This relaxes the check. If some non-critical options are broken, then
ignore the options, but the message itself is still accepted.

Fixes #22099.
2022-01-13 20:20:19 +09:00
Yu Watanabe
2811b1263b
Merge pull request #22100 from bluca/test_part
Fix TEST-58-REPART on ppc64el
2022-01-13 14:00:36 +09:00
Luca Boccassi
8e65d93e85 test: do not assume x86-64 arch in TEST-58-REPART 2022-01-12 23:27:05 +00:00
Luca Boccassi
a94b9977d5 test: add partition IDs for s390x and ppc64el to TEST-50-DISSECT 2022-01-12 22:59:20 +00:00
Daan De Meyer
df207ccb7b journal: Skip data objects with invalid offsets
We already skip invalid objects, but don't yet skip invalid offsets.
Let's skip these as well to improve robustness when we're dealing with
corrupted journals.

Before:

```
➜  systemd git:(main) build/journalctl -r -n 5 --file ~/Downloads/system@0005d2b275abaaf8-f243a2818cb39b98.journal_
Failed to get journal fields: Cannot assign requested address
-- No entries --
```

After:

```
➜  systemd git:(main) ✗ build/journalctl -r -n 5 --file ~/Downloads/system@0005d2b275abaaf8-f243a2818cb39b98.journal_
Dec 09 08:32:38 snowball3 NetworkManager[911]: <info>  [1639038758.1464] device (wlp1s0): supplicant interface state: scanning -> authenticating
Dec 09 08:32:38 snowball3 kernel: wlp1s0: send auth to ec:a9:40:79:fb:ad (try 1/3)
Dec 09 08:32:38 snowball3 kernel: wlp1s0: authenticate with ec:a9:40:79:fb:ad
Dec 09 08:32:38 snowball3 wpa_supplicant[1003]: wlp1s0: SME: Trying to authenticate with ec:a9:40:79:fb:ad (SSID='UPC949397B' freq=5500 MHz)
```
2022-01-12 22:16:40 +01:00
Daan De Meyer
f2eceb5268 journal: Remove unused arguments from journal_file_next_entry_for_data() 2022-01-12 17:31:57 +00:00
Benjamin Berg
6d0aef1dd1 xdg-autostart-service: Ignore missing desktop-sepcific condition binary
If a desktop specific ExecCondition= binary does not exist, this just
means that the desktop environment is not available. As such, it is not
an error condition that should prevent the service from being installed
in the .wants target.

Fix this by simply returning zero.
2022-01-12 16:11:09 +01:00
Zbigniew Jędrzejewski-Szmek
ffb8c82715
Merge pull request #22092 from keszybz/docs-links
Add more doc pages, adjust links, add explanatory headers to examples and relax license to CC-0
2022-01-12 16:06:39 +01:00
Zbigniew Jędrzejewski-Szmek
78afbb67d2 docs: promise stability for the journal json format too 2022-01-12 16:05:59 +01:00
Zbigniew Jędrzejewski-Szmek
717e92ceb9 man+docs: adjust links to the new page 2022-01-12 16:05:59 +01:00
Zbigniew Jędrzejewski-Szmek
d9044a43f6 docs: import the Journal JSON Format description as subsection
I don't think we need a separate page for this, so both "export" formats share
a page.  We can just link to the approprate section when necessary.
2022-01-12 16:05:59 +01:00
Zbigniew Jędrzejewski-Szmek
5e3ab38e70 docs: import the Journal Export Format description from the wiki
This is a straightforward import, only links are adjusted.
2022-01-12 16:05:59 +01:00
Zbigniew Jędrzejewski-Szmek
d6e2c1ab71 policy files: adjust landing page link 2022-01-12 16:05:59 +01:00
Zbigniew Jędrzejewski-Szmek
931bc1957b docs: use https:// for fd.o links 2022-01-12 16:05:59 +01:00
Zbigniew Jędrzejewski-Szmek
2777a4a3bf README: link to the new page
Lennart's blog is now mostly of historical interest, and the wiki
landing page has been replaced by systemd.io.
2022-01-12 16:05:59 +01:00
Zbigniew Jędrzejewski-Szmek
a794a4d872 NEWS: adjust links to moved pages
All those pages contain a redirect at the top of the page, so it doesn't
make much sense to tell people to take the detour. Linking directly will
also increase the search rankings of the new pages.
2022-01-12 16:05:59 +01:00
Zbigniew Jędrzejewski-Szmek
b85c1905e0 shutdown: adjust log message
Instead of saying "with options 'n/a'", let's just say "with options ''".
We really don't have any options.
2022-01-12 16:05:59 +01:00