Commit Graph
55670 Commits
Author SHA1 Message Date
Ludwig Nussel 38d55bf264 systemctl: shutdown don't fallback on auth fail
For shutdowns don't fall back to starting the target directly if talking
to logind failed with auth failure. That would just lead to another
polkit auth attempt.
2022-01-25 17:43:13 +01:00
Ludwig Nussel 5ed73478e1 logind: refactor
Avoid hardcoded strings and string compares related to shutdown actions.
Instead put everything into a common structure. Reuse existing
HandleAction as index since it's already exposed as property for the
button handlers.
2022-01-25 17:43:10 +01:00
Ludwig Nussel ec14fba91c logind: require polkit auth for cancelling shutdowns 2022-01-25 14:56:55 +01:00
Ludwig Nussel 030f37c408 logind: fix wall messages for direct shutdown calls
The wall mechanism uses the scheduled_shutdown_type to determine what
message to send so it needs to be filled in also for the cases that call
for shutdown without schedule.

It's really a hackish way. The overall code needs refacturing.
2022-01-25 14:56:52 +01:00
Ludwig Nussel cdf370626f logind: enable wall messages by default
Something calling directly into the dbus interface to request a
shutdown may not bother turning wall messages on explicitly.

This has the convenient side effect that no separate polkit auth is
required to turn on wall messages. Was annoying as having a wall
message is the default behavior of the commandline tools. Now it's
the other way around ie eg systemctl reboot --no-wall requires auth
to explicitly turn off the wall message.
2022-01-25 14:52:14 +01:00
Ludwig Nussel adefc8789b systemctl: simplify halt_main()
The code at this point is not able to tell whether it was called as
halt/poweroff/reboot or shutdown with time "now".
The code also takes a shortcut to skip logind if called as root.
That however means asking shutdown for immediate action won't trigger a
wall message.
As per https://github.com/systemd/systemd/issues/8424#issuecomment-374677315
all commands should trigger a wall message.
That simplifies the code as we can try logind first always.
2022-01-25 14:52:09 +01:00
Ludwig Nussel 90b1ec03b2 logind: fix wall message for immediate shutdowns
An elapse time of zero means NOW which should trigger a wall
message.
2022-01-25 14:46:37 +01:00
Yu Watanabe 06006691b5 kernel-install: also remove modules.builtin.alias.bin
Fixes RHBZ#2016630.
2022-01-17 12:10:03 +00:00
Luca Boccassi cf18de1b26 systemd-stdio-bridge: add manpage 2022-01-17 16:54:56 +09:00
dependabot[bot] a68b244399 build(deps): bump github/codeql-action from 1.0.26 to 1.0.27
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.0.26 to 1.0.27.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/5f532563584d71fdef14ee64d17bafb34f751ce5...cd783c8a29bdcf5a5c79c5137889e24651fa626c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-17 09:12:55 +03:00
Jan Janssen cc25bedb29 boot: Beep n times for n-th entry 2022-01-17 00:05:35 +00:00
Luca Boccassi 6eed65d455 man: change 'allow[s] to' -> 'allow[s] one to'
Lintian is opinionated about this and we get nagged
2022-01-16 15:49:43 +00:00
Yu Watanabe adc1b76c30 core: add missing dependency DBus properties
Follow-up for 0bc488c99a.

Also sort dependency properties to make them match the definition of
`enum UnitDependency` in basic/unit-def.h.

Fixes #22133.
2022-01-16 14:05:33 +00:00
Yu Watanabe cc8943b84a core: update log message
Fixes CID#1469009.
2022-01-16 14:05:18 +00:00
Luca Boccassi aac3efd24c Merge pull request #22136 from yuwata/network-wireguard-disable-adding-routes-to-allowed-ips-by-default
network: wireguard: disable adding routes to allowed ips by default
2022-01-16 14:04:30 +00:00
Evgeny Vereshchagin e8f93a60a2 ci: install libbpf-dev in the unit_tests workflow
Those dependencies are also used by Coverity and Codeql so
it should be installed there to get them to analyze that code.

Judging by https://github.com/systemd/systemd/pull/22137 it seems
to be working.
2022-01-16 13:13:34 +00:00
Jan Janssen 85d2f13b6f boot: Add PC speaker support
Fixes: #17508
2022-01-16 10:34:01 +00:00
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
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
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