Commit Graph

41324 Commits

Author SHA1 Message Date
Yu Watanabe
f95fb19922 network: introduce QuickAck= for [DHCPv4] and [IPv6AcceptRA]
Closes #25906.
2023-01-16 14:40:22 +09:00
Daan De Meyer
67b65ac62d ukify: Fix version string
Let's make sure we mimick the version of our other CLI tooling.
2023-01-15 22:17:37 +00:00
Yu Watanabe
2cbb171d20 busctl: fix introspecting DBus properties
Follow-up for f2f7785d7a.

Fixes #26033.
2023-01-15 15:39:46 +00:00
Daan De Meyer
85e2e80699 open-file: Fix user-after-free 2023-01-13 17:14:23 +01:00
Franck Bui
6d90488acb udev: simplify a bit stack_directory_find_prioritized_devnode()
And make the new format the one we expect as it should replace the old one
pretty quickly.
2023-01-13 12:06:00 +09:00
Franck Bui
e8a54a4e75 udev: return ENODEV if link_directory_read_one() can't find the devnode
That's usually the errno code we return when a device cannot be found because
it's been unplugged.
2023-01-13 11:22:31 +09:00
Franck Bui
72a459adc4 udev: let stack_directory_open() convert a slink into a dirname itself
We likely always want to open the directory via a slink.

There's currently only one caller so it doesn't make any difference in practice
but I think it's still nicer.

No functional change.
2023-01-13 11:16:14 +09:00
Franck Bui
c9032f910c udev: merge link_directory_lock() into link_directory_open()
These 2 operations are inseparable.
2023-01-13 11:16:10 +09:00
Ludwig Nussel
e443cc7c05 bootspec: show efi entry too 2023-01-13 10:50:18 +09:00
Michal Koutný
b7a41491ed cgroup: Do not emit compat message without memory limit
Previously mere MemoryLow= directive would lead to emitting the compat
message 'Applying MemoryMax=18446744073709551615 as MemoryLimit=' even
though it carries little information.
2023-01-13 10:48:03 +09:00
Daan De Meyer
5228c58ebe dissect-image: Notify btrfs when we're done using a loop device
Let's explicitly let btrfs know when we're done using a loop device.
Otherwise, btrfs will keep the device UUID cached which will result
in mount() failures if we ever generate a device or filesystem with
the same UUID again.
2023-01-12 16:36:09 +01:00
Zbigniew Jędrzejewski-Szmek
2c281e6db5 Merge pull request #25661 from yuwata/systemctl-suppress-warning
systemctl: suppress warning about missing /proc/ when --no-warn
2023-01-12 08:41:05 +01:00
Daan De Meyer
a2640646f1 network: Show network and link file dropins in networkctl status
Fixes #24428
2023-01-12 13:44:52 +09:00
Alvin Šipraga
9c5b8d46e5 network: fix race between RTM_NEWLINK and NL82011_CMD_NEW_INTERFACE
When a new wireless network interface is created by the kernel, it emits
both RTM_NEWLINK and NL80211_CMD_NEW_INTERFACE. These events can arrive
in either order and networkd must behave correctly in both cases.

The typical case is that RTM_NEWLINK is handled first, in which case
networkd creates a Link object and starts tracking it. When the
NL80211_CMD_NEW_INTERFACE message is handled, networkd then populates
the Link object with relevant wireless properties such as wireless
interface type (managed, AP, etc.).

In the event that the order is reversed however, networkd will fail to
populate these wireless properties because at the time of processing the
nl80211 message, the link is considered unknown. In that case, a debug
message is emitted:

  systemd-networkd[467]: nl80211: received new_interface(7) message for link '109' we don't know about, ignoring.

This is problematic because after the subsequent RTM_NEWLINK message,
networkd will have an incomplete view of the link. In particular, if a
.network configuration matches on some of the missing wireless
properties, such as WLANInterfaceType=, then it will never match.

The above race can be reproduced by using the mac80211_hwsim driver.
Suppose that there exists a .network configuration:

  [Match]
  WLANInterfaceType=ap
  ...

Now loop the creation/destruction of such an AP interface:

  while true
  do
    iw dev wlan0 interface add uap0 type __ap
    iw dev uap0 del
  done

The above debug message from networkd will then be observed very
quickly. And in that event, the .network file will fail to match.

To address the above race, have the nl80211 message handler store the
interface index in a set in case a Link object is not found on
NL80211_CMD_NEW_INTERFACE. The handler for RTM_NEWLINK can then query
this set, and explicitly request the wireless properties from nl80211
upon the creation of the Link object.
2023-01-12 13:28:36 +09:00
chris
ea57796854 optionally set socket priority on DHCPv4 raw socket 2023-01-12 13:26:47 +09:00
Yu Watanabe
91dfb74ef5 systemctl: suppress warning about missing /proc/ when --no-warn
Follow-up for 0f958c8d4f.

systemctl is called many times by dnf or so, and missing /proc/ is not
a user's fault, but package manager's issue.
With this commit, we can suppress the warning by updating rpm macros if
necessary.
2023-01-12 11:50:41 +09:00
Jan Engelhardt
41fca8686f coredump: re-document raised default dump sizes
Commit v250-767-ge677041e7a updated the built-in configuration, but
missed the accompanying documentation.
2023-01-11 18:14:58 +01:00
Franck Bui
2aba77057e journal: give the ability to enable/disable systemd-journald-audit.socket
Before this patch the only way to prevent journald from reading the audit
messages was to mask systemd-journald-audit.socket. However this had main
drawback that downstream couldn't ship the socket disabled by default (beside
the fact that masking units is not supposed to be the usual way to disable
them).

Fixes #15777
2023-01-11 17:18:57 +01:00
Lennart Poettering
5e476b8512 tree-wide: fix return value handling of base64mem()
This returns an ssize_t, not an int. On populare archs that's the
difference between 64bit and 32bit. hence, let's be more careful here,
and not silently drop half the bits on the ground by assigning the
return value to "int".

As noticed by @malikabhi05:

https://github.com/systemd/systemd/pull/24754#discussion_r1062903159
2023-01-11 10:46:08 +01:00
Lennart Poettering
a71e17f3e0 hexdecoct: modernize base64mem() variable naming a bit
Just some renaming addressing the fact we otherwise always call return
parameters "ret", and the local error variable "r".

no change in behaviour.
2023-01-11 10:46:08 +01:00
Luca Boccassi
fae081492e Merge pull request #26014 from yuwata/network-l2tp-fixes
network: L2TP fixlets
2023-01-11 09:32:50 +00:00
Jan Janssen
c8add4c2e8 ukify: Fix tools detection if --tools was not passed
In 789a642738 llvm-objcopy was given
higher priority over objcopy, but this would only work if --tools was
also passed.
2023-01-11 09:29:41 +01:00
Lennart Poettering
833504f061 Merge pull request #25916 from poettering/reload-notify
pid1: add new Type=notify-reload service type for a service reload protocol based on SIGHUP
2023-01-11 09:23:47 +01:00
Yu Watanabe
bf4a5ac804 network/l2tp: parse address or address type from correct string
Fixes a bug introduced by 8b49ee2dcd.

Fixes #26011.
2023-01-11 13:20:14 +09:00
Yu Watanabe
4da53043a6 network/l2tp: fix error code in log message 2023-01-11 13:11:00 +09:00
Luca Boccassi
c32b049dfb Merge pull request #25986 from yuwata/test-netlink
test-netlink: cleanups
2023-01-10 21:21:24 +00:00
Lennart Poettering
fd0f4da545 notify: add --stopping + --reloading switches
These wrap RELOADING=1 and STOPPING=1 messages. The former is
particularly useful, since we want to insert the MONOTONIC_USEC= field
into the message automatically, which is easy from C but harder from
shell.
2023-01-10 18:28:38 +01:00
Lennart Poettering
5d71e463f4 logind: implement Type=notify-reload protocol properly
So close already. Let's add the two missing notifications too.

Fixes: #18484
2023-01-10 18:28:38 +01:00
Lennart Poettering
f84331539d udevd: implement the full Type=notify-reload protocol
We are basically already there, just need to add MONOTONIC_USEC= to the
RELOADING=1 message, and make sure the message is generated in really
all cases.
2023-01-10 18:28:38 +01:00
Lennart Poettering
0e07cdb0e7 networkd: implement Type=notify-reload protocol 2023-01-10 18:28:38 +01:00
Lennart Poettering
dd0ab174c3 pid1: make sure we send our calling service manager RELOADING=1 when reloading
And send READY=1 again when we are done with it.

We do this not only for "daemon-reload" but also for "daemon-reexec" and
"switch-root", since from the perspective of an encapsulating service
manager these three operations are not that different.
2023-01-10 18:28:38 +01:00
Lennart Poettering
3bd28bf721 pid1: add new Type=notify-reload service type
Fixes: #6162
2023-01-10 18:28:38 +01:00
Lennart Poettering
7fa49280bc manager: add one more assert() 2023-01-10 18:28:38 +01:00
Lennart Poettering
a6edc20fa6 Merge pull request #26003 from keszybz/efi-ifdefs
Fix one compile-time conditional and refactor SD_BOOT definition
2023-01-10 18:28:10 +01:00
Ludwig Nussel
2e76ca79b3 bootctl: honor $KERNEL_INSTALL_CONF_ROOT
Honor $KERNEL_INSTALL_CONF_ROOT for reading config files, as
kernel-install does.
2023-01-10 15:17:07 +01:00
Richard Phibel
cd48e23f6a core: add OpenFile setting 2023-01-10 15:16:26 +01:00
Lennart Poettering
9914ae6038 shutdown: don't close pipe fds.
Man, I royally screwed this one up! 😳

Fixes: #25998
2023-01-10 14:51:46 +01:00
Daan De Meyer
68634c2665 Merge pull request #24939 from msizanoen1/journal-realtime-enforce-consistency
journal: enforce strict consistency for realtime timestamps on write
2023-01-10 14:30:53 +01:00
Zbigniew Jędrzejewski-Szmek
493cd5034c meson: use 0|1 for SD_BOOT
We converted to not using #ifdef for most of our defines because the syntax is
nicer and we are protected against typos and can set -Werror=undef. Let's do
the same for SD_BOOT. The define is nicely hidden in build.h for normal builds,
and for EFI builds we were already setting SD_BOOT on the commandline.
2023-01-10 14:25:57 +01:00
Zbigniew Jędrzejewski-Szmek
5deb391c6e fundamental: fix compile check for explicit_bzero
Our HAVE_* variables are defined to 0 or 1, so '#if defined(HAVE_*)' is always true.
The variable is not defined when compiling for EFI though, so we need the
additional guard.

Fixup for 3f92dc2fd4.

(I don't want to do something like add -DHAVE_EXPLICIT_BZERO=0 to the commandline
in src/efi/boot/meson.build, because this quite verbose. Our compilation commandlines
are very long already. Let's instead keep this localized in this one spot in the
source file.)x
2023-01-10 14:23:27 +01:00
Ludwig Nussel
5fe34dbfeb kernel-install: refactor some variables
In preparation for plugin support
2023-01-10 13:49:31 +01:00
Yu Watanabe
5ccbe7fb19 test-netlink: use dummy interface to test assigning new interface name
Fixes #25981.
2023-01-10 21:01:59 +09:00
Yu Watanabe
5afaf40712 shutdown: propagate the original errno
Follow-up for b293bb2316.
2023-01-10 12:06:49 +01:00
Lennart Poettering
4afe2fb2f8 Merge pull request #25980 from yuwata/udev-fail-to-rename-netif
udev,pid1: gracefully handle failure in renaming network interface
2023-01-10 09:44:42 +01:00
Yu Watanabe
e9336d6ac3 core/device: ignore failed uevents
When udevd failed to process the device, SYSTEMD_ALIAS or any other
properties may contain invalid values. Let's refuse to handle the uevent.
2023-01-10 14:25:20 +09:00
Yu Watanabe
58b0a3e511 core/device: downgrade log level for ignored errors 2023-01-10 14:25:20 +09:00
Yu Watanabe
eedfef0f0d sd-device: introduce device_get_property_int() 2023-01-10 14:25:20 +09:00
Yu Watanabe
210033847c udev: restore syspath and properties on failure
Otherwise, invalid sysname or properties may be broadcast to udev
listeners.
2023-01-10 14:25:16 +09:00
Lennart Poettering
b293bb2316 shutdown: propagate mount() failures from child to parent
Let's propagate the actual error code up, as we usual do.

Inspired by: #25168
2023-01-09 22:17:04 +01:00
Lennart Poettering
e29684a1ba Merge pull request #25982 from mrc0mmand/curl-scheme
Fix build with the latest libcurl
2023-01-09 18:59:20 +01:00