1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-25 10:04:04 +03:00

51956 Commits

Author SHA1 Message Date
Ivan Kruglov
7779d4944c json: introduce json_dispatch_strv_environment()
I just moved json_dispatch_environment() from src/shared/user-record.c
under name 'json_dispatch_strv_environment()' to shared json code.
2024-11-06 11:37:51 +01:00
Ivan Kruglov
b0eca6dee0 machine: machine_default_shell_path() & machine_default_shell_args() helper functions 2024-11-06 11:37:51 +01:00
Ivan Kruglov
41f1f283d7 machine: introduce machine_start_getty() and machine_start_shell() helpers 2024-11-06 11:37:51 +01:00
Yu Watanabe
df69f29728
network: reconfigure interface more gracefully (#35035)
split-out of #34989.
2024-11-06 17:57:56 +09:00
Lennart Poettering
682195a00a
UKI: Introduce .dtbauto sections (#34855)
Split out from #34158
2024-11-06 09:29:04 +01:00
Andres Beltran
f348831d27 namespace-util: make idmapping not supported if syscalls return EPERM 2024-11-06 09:27:33 +01:00
Zbigniew Jędrzejewski-Szmek
ddcdc6b365
mount-util: introduce path_is_network_fs_harder() and use it in networkd (#35040)
Closes #32426.
2024-11-06 08:39:24 +01:00
anonymix007
1d79f667f4 stub: Handle .dtbauto sections 2024-11-06 00:47:04 +03:00
anonymix007
4c0b7f4250 measure: Introduce .dtbauto support 2024-11-06 00:47:04 +03:00
anonymix007
630cf4e7da uki: add new .dtbauto PE section type
.dtbauto section contains DT blobs, just like .dtb, the difference is
that multiple .dtbauto sections are allowed to be in a UKI and only one
is selected automatically

Temporarily drop an assert_cc() check in systemd-measure to make it compilable before the next commit
2024-11-06 00:47:04 +03:00
anonymix007
763028a16c measure: introduce support for a .hwids section 2024-11-06 00:47:04 +03:00
anonymix007
c033267912 boot: Add .dtbauto section matching in PE section discovery against HWIDs and FW-provided DT 2024-11-06 00:46:57 +03:00
Ronan Pigott
57feaaece3 network: handle ENODATA better with DNR
It is normal for DHCP leases not to have DNR options. We need to be less
verbose and more forgiving in these cases. Also, if either DHCP does not
have DNR options, make sure to still consider any DHCPv6/RA options.

Fixes: c7c9e3c7c016 (network: adjust log message about DNR)
2024-11-06 05:01:55 +09:00
Yu Watanabe
c0323de6ca network: use path_is_network_fs_harder()
Closes #32426.
2024-11-06 04:58:59 +09:00
Yu Watanabe
d49d95df0a mount-util: introduce path_is_network_fs_harder()
It also detects e.g. glusterfs or mounts with "_netdev" option.
2024-11-06 04:58:55 +09:00
Zbigniew Jędrzejewski-Szmek
2257be13fe tree-wide: time-out → timeout
For justification, see 3f9a0a522f2029e9295ea5e9984259022be88413.
2024-11-05 19:32:19 +00:00
anonymix007
6bb76ab959 boot: Add HWID calculation from SMBIOS strings and matching against a built-in list 2024-11-05 22:29:58 +03:00
anonymix007
1c3a0a4b1f boot: Add firmware_devicetree_exists() 2024-11-05 22:29:58 +03:00
Diogo Ivo
e6cb29fa0f boot: add matching against FW-provided Devicetree blob
Add support for matching the DT contained in a .dtb section of the
UKI image against the FW provided FDT or arbitrary compatible.
2024-11-05 22:29:40 +03:00
Luca Boccassi
7af37f3a90
Add PrivatePIDs= (continued) (#34940) 2024-11-05 18:42:28 +00:00
Yu Watanabe
6e0c9b7dac network: introduce LINK_RECONFIGURE_CLEANLY flag
And use it when explicit reconfiguration is requested by Reconfigure() DBus method
or networkd certainly detects that connected network is changed.
Otherwise do not use the flag especially when we come back from sleep mode.
2024-11-06 02:05:00 +09:00
Yu Watanabe
451c2baf30 network: keep dynamic configurations as possible as we can on reconfigure
E.g. when a .network file is updated, but DHCP setting is unchanged, it
is not necessary to drop acquired DHCP lease.
So, let's not stop DHCP client and friends in link_reconfigure_impl(),
but stop them later when we know they are not necessary anymore.

Still DHCP clients and friends are stopped and leases are dropped when
the explicit reconfiguration is requested
2024-11-06 02:05:00 +09:00
Yu Watanabe
dd6d53a8dc network: merge link_foreignize_config() and link_drop_foreign_config()
When a reconfiguration of an interface is triggered, previously we
call link_foreignize_config(), which sets all static configurations as
foreign, then later call link_drop_foreign_config(), which drops
unnecessary foreign configurations.

This commit merges these two steps into one, link_drop_unmanaged_config(),
which drops unnecessary static and foreign configurations.

Also, this renames link_drop_managed_configs() to
link_drop_static_config(), as it only drops static configurations.
Note that dynamically aquired configurations are dropped by
link_stop_engines().
2024-11-06 02:05:00 +09:00
Yu Watanabe
2b07a3211b network: several cleanups for link_reconfigure()
Effectively no functional changes, just refactoring and preparation for
later changes.

- convert boolean flag 'force' to LinkReconfigurationFlag enum,
- merge link_reconfigure() and reconfigure_handler_on_bus_method_reload() as
  link_reconfigure_full(),
- Rename ReconfigureData -> LinkReconfigurationData,
- make Reconfigure() DBus message wait for reconfiguration being
  started before sending reply.
2024-11-06 02:05:00 +09:00
Yu Watanabe
5a1ef6dffb network: split out link_enter_unmanaged() from link_reconfigure_impl()
No functional change, just refactoring.
2024-11-06 02:05:00 +09:00
Lennart Poettering
9810899ef2 run: handle gracefully if we can't find binary client-side due to perms
Fixes: #35022
2024-11-05 13:41:20 +00:00
Daan De Meyer
406f177501 core: Introduce PrivatePIDs=
This new setting allows unsharing the pid namespace in a unit. Because
you have to fork to get a process into a pid namespace, we fork in
systemd-executor to get into the new pid namespace. The parent then
sends the pid of the child process back to the manager and exits while
the child process continues on with the rest of exec_invoke() and then
executes the actual payload.

Communicating the child pid is done via a new pidref socket pair that is
set up on manager startup.

We unshare the PID namespace right before the mount namespace so we
mount procfs correctly. Note PrivatePIDs=yes always implies MountAPIVFS=yes
to mount procfs.

When running unprivileged in a user session, user namespace is set up first
to allow for PID namespace to be unshared. However, when running in
privileged mode, we unshare the user namespace last to ensure the user
namespace does not own the PID namespace and cannot break out of the sandbox.

Note we disallow Type=forking services from using PrivatePIDs=yes since the
init proess inside the PID namespace must not exit for other processes in
the namespace to exist.

Note Daan De Meyer did the original work for this commit with Ryan Wilson
addressing follow-ups.

Co-authored-by: Daan De Meyer <daan.j.demeyer@gmail.com>
2024-11-05 05:32:02 -08:00
anonymix007
26060eb7a0 fundamental: Add HWID calculation 2024-11-05 14:48:43 +03:00
anonymix007
09f16de6d8 boot: Add xnew0
Same as xnew but initialized with zeros
2024-11-05 14:48:33 +03:00
Zbigniew Jędrzejewski-Szmek
ee95e86ae1 resolved: log error messages for openssl/gnutls context creation
In https://bugzilla.redhat.com/show_bug.cgi?id=2322937 we're getting
an error message:
Okt 29 22:21:03 fedora systemd-resolved[29311]: Could not create manager: Cannot allocate memory
I expect that this actually comes from dnstls_manager_init(), the
openssl version. But without real logs it's hard to know for sure.

Use EIO instead of ENOMEM, because the problem is unlikely to be actually
related to memory.
2024-11-05 11:59:29 +01:00
Ronan Pigott
a791fea0d6 network: limit the total number of Encrypted DNS options processed
We need a sensible limit on the number of Encrypted DNS options allowed
so that the set of resolvers per link does not grow without bound.

Fixes: 0c90d1d2f243 ("ndisc: Parse RFC9463 encrypted DNS (DNR) option")
2024-11-05 09:33:35 +01:00
Luca Boccassi
1da80d2ca3
sd-daemon: some tweaks (#35011) 2024-11-05 00:56:28 +00:00
Luca Boccassi
c53df275d5 test: fix tool name in comment 2024-11-04 20:27:00 +00:00
Yu Watanabe
995d0296e9
network: sevearal random trivial cleanups (#34994)
split-out of #34989.
2024-11-05 04:16:44 +09:00
Daan De Meyer
b5dc805583 tmpfiles: Implement L? to only create symlinks if source exists
This allows a single tmpfiles snippet with lines to symlink directories
from /usr/share/factory to be shared across many different configurations
while making sure symlinks only get created if the source actually exists.
2024-11-04 19:04:21 +01:00
Yu Watanabe
8c3d6d7150 network/dhcp4: keep DHCP address and routes on stop even when SendDecline=yes
KeepConfiguration=dhcp or dhcp-on-stop already violate RFC. It is not
necessary to honor the RFC about sending decline message on stop.
2024-11-05 02:56:48 +09:00
Yu Watanabe
2afd12e0a1 network: expose log_route_debug() and log_address_debug()
They will be used in another file in a later commit.
2024-11-05 02:55:15 +09:00
Yu Watanabe
6119221afa network: add more debugging logs
This also fixes the position of the logging "Enumeration completed.",
and downgrade its log level.
2024-11-05 02:55:15 +09:00
Yu Watanabe
9c402e3ae2 network: check if interface is initialized after enumeration completed
We enumerate interfaces at first, then enumerate other configurations
like addresses and so on. If we are running on a container, previously
we started to configure the enumerated interfaces before enumerating other
configurations.
Let's configure interfaces after all configurations are enumerated.
2024-11-05 02:55:15 +09:00
Yu Watanabe
30d5d11be0 network: check earlier if we are running in test mode 2024-11-05 02:55:15 +09:00
Yu Watanabe
bf6e9b383d network: introduce network_config_source_from_string()
It is currently unused, but will be used later.
Preparation for later commits.
2024-11-05 02:55:15 +09:00
Yu Watanabe
5ca212a984 network/json: add missing entries for route properties 2024-11-05 02:55:15 +09:00
Yu Watanabe
ae65974883 network: remove unexpected netlink socket from service manager 2024-11-05 02:55:15 +09:00
Yu Watanabe
20465bcb1e daemon-util: expose notify_push_fd()
It will be used in a later commit.
2024-11-05 02:55:15 +09:00
Yu Watanabe
dc12457bfd network/address: slightly optimize link_address_is_dynamic() 2024-11-05 02:55:03 +09:00
Yu Watanabe
b5a8440f55 network: realign string table 2024-11-05 02:54:02 +09:00
Daan De Meyer
89fdca7168 exec-invoke: Add debug logging for setup_private_users() 2024-11-04 09:19:36 -08:00
Franck Bui
c52f6c1f33 efi-loader: add missing stub for efi_stub_get_device_part_uuid() 2024-11-04 17:18:23 +00:00
Lennart Poettering
679a95593d
json: add json_dispatch_ifindex() helper (#34982)
Inspired by: #34640
2024-11-04 15:19:51 +01:00
Daan De Meyer
e37701a8cd pcrlock: Pad pe hash to a multiple of 8 bytes
All other tools (sbsigntools, osslsigncode, sbctl, goblin) do this
as well so let's follow suite.
2024-11-04 14:08:54 +01:00