1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00
Commit Graph

77247 Commits

Author SHA1 Message Date
Mike Gilbert
ff94426f8a posix_spawn_wrapper: do not set POSIX_SPAWN_SETSIGDEF flag
Setting this flag is a noop without a corresponding call to
posix_spawnattr_setsigdefault.

If we call posix_spawnattr_setsigdefault with a full signal set,
it causes glibc's posix_spawn implementation to call sigaction 63 times,
once for each signal. That seems wasteful.

This feature is really only useful for signals which have their
disposition set to SIG_IGN. Otherwise the dispostion gets set to
SIG_DFL automatically, either by clone(CLONE_CLEAR_SIGHAND) or the
subsequent execve.

As far as I can tell, systemd does not have any signals set to SIG_IGN
under normal operating conditions.
2024-10-31 18:16:58 +01:00
Daan De Meyer
1f9425d1c4 mkosi: Install gdb in centos/fedora build image
Lack of gdb-add-index has become a fatal error in Rawhide/c10s so
let's install gdb to make rpmbuild happy.
2024-10-31 13:44:13 +00:00
Yu Watanabe
3d8f2c1464 resolve: do not try to send varlink error more than once
After d2ebf5cc1d, sd_varlink_error() and
friends return negative errno.

Fixes https://github.com/systemd/systemd/pull/34946#discussion_r1823703636.
2024-10-31 18:45:08 +09:00
Yu Watanabe
5310cf3354 NEWS: fix typo 2024-10-31 10:58:25 +09:00
Yu Watanabe
ba63cc7448 sd-varlink: update comment 2024-10-31 09:52:15 +09:00
Lennart Poettering
d2ebf5cc1d sd-varlink: change sd_varlink_error() to always return an error
Let's make sure that sd_varlink_error() always returns an error code, so
that we can use it in a style "return sd_varlink_error(…);" everywhere,
which has two effects: return a good error reply to clients, and exit
the current stack frame with a failure code.

Interestingly sd_varlink_error_invalid_parameter() already worked like
this in some cases, but sd_varlink_error() itself didn't.

This is an alternative to the error handling tweak proposed in #34882,
but I think is a lot more generically useful, since it establishes a
pattern.

I checked our codebase, and this change should generally be OK without
breaking callsites, since the current callers (with exception of the
machined case from #34882) called sd_varlink_error() in the outermost
varlink method call dispatch stack frame, where this behaviour change
does not alter anything.

This is similar btw, how sd_bus_error_setf() and friends always return
error codes too, synthesized from its parameters.
2024-10-31 09:50:50 +09:00
Lennart Poettering
76a3af0630 sd-varlink: add helper VARLINK_STATE_WANTS_REPLY()
Let's add a helper that detects whether we still need to reply to a
state. This should make the logic easier to follow.
2024-10-31 09:50:50 +09:00
Lennart Poettering
aa5e67ae6f sd-varlink: don't show error code we already decoded as part of the log message 2024-10-31 09:50:50 +09:00
Lennart Poettering
0118074f85 sd-varlink: if we reply to errors without passing to callback, go through regular error path
If replying with an error fails, we should failt the whole connection,
and not leave the connection in a weird state.
2024-10-31 09:50:50 +09:00
Yu Watanabe
885691d454
firstboot: several cleanups (#34958)
Split out of #33226
2024-10-31 08:05:39 +09:00
Lennart Poettering
2ff3adeb29 sd-json: don't use C99 bool in public headers
All our public headers strive to C90 compatibility with a few
extensions, and thus avoided stdbool.h and bool.

The sd_json_format_enabled() helper seems like a poor place to start
requiring stdbool.h now.

Also drop __extension__ since we are not using it anywhere else in very
similar inline functions.

(And we probably should drop any _sd_const declarations on inline
functions. Given that the compiler has the function implementation
around always, because it's in the header there's really no reason to
specify this manually, the compiler can trivially figure this out on its
own. But that's for another time.)
2024-10-31 07:59:41 +09:00
Yu Watanabe
cb15aa7b37
network: support reconfiguring netdev (#34909)
Closes #9627
Closes #27177.
Closes #34907.
Replaces #22557.
2024-10-31 07:01:46 +09:00
Yu Watanabe
2e612ce1b7 man: update documentation for 'networkctl reload' 2024-10-31 05:33:10 +09:00
Yu Watanabe
0de5562413 test-network: test for reload of .netdev file of stacked netdev
For issue #9627, #27177, and #34907.
2024-10-31 05:30:40 +09:00
Yu Watanabe
b3ae4e8622 network/netdev: replace old NetDev object with newer one on reload
Then, when a .netdev file of a stacked netdev is modified, the netdev
can be reconfigured with the updated setting by something like the
following way:
```
ip link del vlan99
networkctl reload
```

Note, removing the vlan interface in the above example may not be necessary,
e.g. when only VLAN flags, egress mapping, or ingress mapping are updated.
But, it is necessary when VLAN ID is updated.

Closes #9627.
Closes #27177.
Closes #34907.
Replaces #22557.
2024-10-31 05:30:40 +09:00
Yu Watanabe
890bd7225a network/netdev: reconfigure netdev if possible
Some netdev configs can be modified after the interface is created.
Let's allow to reconfigure existing interfaces.
2024-10-31 05:30:40 +09:00
Yu Watanabe
933d88f756 network/netdev: move calls of netdev_attach() and netdev_request_to_create() to netdev_load()
No functional change, preparation for later commits.
2024-10-31 05:30:40 +09:00
Daan De Meyer
954dd5242b mkosi: Ensure we build with debuginfo 2024-10-30 19:48:18 +00:00
Michal Sekletar
d9fd1d3707 coredump: allow only empty messages after first "sentinel" 2024-10-30 19:45:31 +00:00
Michael Ferrari
178d80d719
firstboot: generalize prompt_loop more
Allows unifying the custom logic for the hostname and root shell. Root
password prompting remains separate as it's logic is substantially
different to the other prompts.
2024-10-30 20:13:56 +01:00
Michael Ferrari
26f9e08231
firstboot: use consistent wording for prompts 2024-10-30 20:13:53 +01:00
Michael Ferrari
f4da5ed538
firstboot: clean up welcome message 2024-10-30 20:13:47 +01:00
Michael Ferrari
d689dd88fd
firstboot: order non-interactive options last 2024-10-30 20:13:41 +01:00
Yu Watanabe
f7d5d7c593
network/tunnel: reuse existing 6rd sit tunnel (#34938)
split-out of #34909.
2024-10-31 04:04:55 +09:00
Yu Watanabe
5251cb8254
network/netdev: do not try to update several parameters if the interface already exists (#34937)
split-out of #34909.
2024-10-31 04:04:33 +09:00
Yu Watanabe
e725a91ab7
network: several cleanups for reloading .network files (#34933)
split-out of #34909.
2024-10-31 04:04:10 +09:00
Yu Watanabe
6ab12224c9
network: process queued remove requests on stop (#34871)
Fixes a regression caused by 85a6f300c1
and its later commits.
Fixes #34837.
2024-10-31 04:03:11 +09:00
Yu Watanabe
d1fd45d145
mkosi: Update packaging specs to latest (#34951) 2024-10-31 02:31:03 +09:00
Yu Watanabe
59528e55af test-network: add test case for reuse of existing 6rd SIT tunnel 2024-10-31 02:09:31 +09:00
Lennart Poettering
f2ef9f7760
Fix display of qrcodes by bsod and other related cleanups (#34914) 2024-10-30 17:44:40 +01:00
Daan De Meyer
d9f4dad986 ask-password: Allow configuring the keyring timeout via an environment variable
In mkosi, we want an easy way to set the keyring timeout for every
tool we invoke that might use systemd-ask-password to query for a
password which is then stored in the kernel keyring. Let's make this
possible via a new $SYSTEMD_ASK_PASSWORD_KEYRING_TIMEOUT_SEC environment
variable.

Using an environment variable means we don't have to modify every separate
tool to add a CLI option allowing to specify the timeout. In mkosi specifically,
we'll set up a new session keyring for the mkosi process linked to the user keyring
so that any pins in the user keyring are used if available, and otherwise we'll query
for and store password in mkosi's session keyring with a zero timeout so that they stay
in the keyring until the mkosi process exits at which point they're removed from the
keyring.
2024-10-30 17:43:53 +01:00
Luca Boccassi
14b0fcdf6d logind: add BlockWeakInhibited property
Fixes https://github.com/systemd/systemd/issues/34091
Follow-up for 804874d26a
2024-10-30 17:41:52 +01:00
Łukasz Stelmach
8144537a81 core: make mount(8) and swapon(8) inherit SMACK label from systemd
By default mount(8), umount(8), swapon(8) and swapoff(8) should run with
with the SMACK label inherited from systemd rather than the default one
meant for services.

Fixes: aa5ae9711e
Follow-up-for: 20bbf5ee4c
2024-10-30 17:41:23 +01:00
Yu Watanabe
ceae9f9a38 network/ipvlan: do not try to update MAC address 2024-10-31 01:06:25 +09:00
Yu Watanabe
6804bbdaf1 network/macsec: IFLA_MACSEC_PORT attribute cannot be changed
Also, though currently not supported by networkd,
  IFLA_MACSEC_CIPHER_SUITE, IFLA_MACSEC_ICV_LEN, IFLA_MACSEC_SCI
cannot be updated.
2024-10-31 01:06:25 +09:00
Yu Watanabe
49639363ab network/vxlan: do not try to update several parameters
Currently, netdev->ifindex is always zero when this function is called.
So, this does not change any behavior. Preparation for later commits.
2024-10-31 01:06:25 +09:00
Yu Watanabe
17c5337f7b network/netdev: introduce netdev_can_set_mac/mtu() helper functions
Several netdevs cannot set IFLA_ADDRESS or IFLA_MTU attribute on update.
Currently, the vtable field is unused, as we do not support updating
existing netdevs. Preparation for later commits.
2024-10-31 01:06:25 +09:00
Yu Watanabe
00c0a94498 network: use newly loaded Network object if a referenced NetDev object is updated
Even if .network file is not updated, referenced NetDev object may be
different. In that case, let's use the newly loaded Network object.
2024-10-31 00:58:47 +09:00
Yu Watanabe
173c9f639b network: drop no-op cleanup
- network_load() is always called with an empty OrderedHashmap, renamed the output
  parameter to 'ret'.
- When netdev_load() is called on startup, the hashmap is NULL. When it is
  called on reloading, the hashmap is not cleaned up.

Hence, then these cleanups are always no-op. Let's drop them.
2024-10-31 00:58:42 +09:00
Yu Watanabe
d16083557b network/netdev: update state file when NetDev object assignment is changed 2024-10-31 00:52:28 +09:00
Yu Watanabe
525c53a95a network: swap asterisk and space 2024-10-31 00:51:50 +09:00
Yu Watanabe
f85213e8f6 github: drop workaround and use distro mold
Now, ubuntu-24.04 has mold-2.30.0+dfsg-1build1 .
See https://packages.ubuntu.com/noble/mold .
2024-10-31 00:34:48 +09:00
Yu Watanabe
58a011ba48 test-network: add test for DHCPv4 address removal on stop
For issue #34837.
2024-10-31 00:34:48 +09:00
Yu Watanabe
db68e99046 network: process queued remove requests before networkd is stopped
This makes networkd process all queued remove requests when a
terminating or restarting signal is received. Otherwise, e.g. DHCPv4
address will not be removed on stop, especially when
KeepConfiguration=no.

Fixes a bug introduced by 85a6f300c1 and
its subsequent commits.

Fixes #34837.

Co-authored-by: Will Fancher <elvishjerricco@gmail.com>
2024-10-31 00:34:44 +09:00
Daan De Meyer
f512934164 mkosi: update debian commit reference
* 2f288667e0 Install sysupdate.feature manpage
* 384393a955 d/systemd.postrm: delete more internal state directories on purge
2024-10-30 16:31:39 +01:00
Daan De Meyer
a86b011158 mkosi: update arch commit reference
* 62c224b60c Specify --no-rebuild when calling meson install
* b5c20dc6b0 fix redirection for dash
* 7fef8e4cdd upgpkg: 256.7-1: new upstream release
2024-10-30 16:29:43 +01:00
Luca Boccassi
58ada3eab2
coredump: AccessContainer= bunch of followups (#34333)
Fixes #34130
2024-10-30 14:37:44 +00:00
Zbigniew Jędrzejewski-Szmek
c8b774463e NEWS: remove duplicated entry
The same item is described below.

Also reflow some paragraphs (presumably indented with emacs, which does this
wrong).
2024-10-30 15:09:26 +01:00
Zbigniew Jędrzejewski-Szmek
10faa40ba7 cryptenroll,homectl,journalctl: adjust messages before qrcodes
Users will generally know what a qrcode is, so let's not treat them as dumb and
explain that it can be scanned. OTOH, we should say what the qrcode contains
and it is useful to give a hint why the users would want to scan it. Reword
messages accordingly.

(Also, don't say "to your phone", when somebody might be using a stolen phone,
or something else then a phone.)
2024-10-30 15:03:18 +01:00
Zbigniew Jędrzejewski-Szmek
abf1cae0a7 bsod: make message for qrcode more useful
People know what a qrcode is. We don't need to tell them to scan it.
Instead, we should say what the code contains.

While at it, rename "stream" to "f" in line with the usual style.
2024-10-30 15:03:17 +01:00