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

70957 Commits

Author SHA1 Message Date
Yu Watanabe
a140eaf16a network: fix typo
Follow-up for baa95d2274179e680c4731a74f514e2651722ad2.
2024-02-09 14:15:17 +09:00
Yu Watanabe
bbcd088031
Merge pull request #31177 from yuwata/network-ndisc-on-link-zero
network/ndisc: drop onlink prefix route when on-link flag is zero
2024-02-09 14:03:32 +09:00
mille-feuille
baa90b4b81 detect-virt: fix Google Compute Engine support
Follow-up for 9b0688f491674b53ef7a52bdf561a430c53673d6
2024-02-09 12:12:33 +09:00
Zbigniew Jędrzejewski-Szmek
56afff50b9 preset: enable homed sidecar services
As described in https://github.com/systemd/systemd/issues/31235, the preset
state for systemd-homed-activate.service was unclear. On the one hand, we have
a preset with 'enable systemd-homed.service', and systemd-homed.service has
'Also=systemd-homed-activate.service systemd-homed-firstboot.service', so
'preset systemd-homed.service' would also enable those two services, but
'preset systemd-homed-activate.service' would disable it, because the presets
don't say it is enabled. It seems that this configuration is internally
inconsistent. As described in the issue, maybe systemctl should be smarter
here, or warn about such configs. Either way, let's make our config consistent.

Follow-up for d1f6e01e4743ae94740314eeb46a162112ef4599 and
3ccadbce3358ba1db7ce5fa3f8dd17c627ffd93b.
2024-02-08 22:44:00 +00:00
Luca Boccassi
82047a6aa7 portable: add --copy=mixed to copy images and link profiles
This new mode copies resources provided by the client, so that they
remain available for inspect/detach even if the original images are
deleted, but symlinks the profile as that is owned by the OS, so that
updates are automatically applied.
2024-02-08 21:11:26 +00:00
Zbigniew Jędrzejewski-Szmek
eb47031694 man: mention that preset-all is performed during early boot
The intro of systemd-firstboot is rewritten to make it clearer how it fits into
the big picture. Systemd does some machine-id and presets and
systemd-firstboot.service is used to interactively fill in the blanks.

Closes #22225.
2024-02-08 20:36:44 +01:00
Antonio Alvarez Feijoo
316918640f creds: fix typo 2024-02-08 19:48:49 +01:00
Lennart Poettering
9d99f1686a
Merge pull request #30766 from polarina/cryptenroll-tpm2-unlock
cryptenroll: Add support for unlocking through TPM2 enrollments
2024-02-08 17:41:03 +01:00
Sam Leonard
710dcce13f nspawn: add missing OOM check on gethostname_malloc() 2024-02-08 16:05:31 +01:00
Sam Leonard
2978e540e4 vmspawn: remove extraneous log_info 2024-02-08 16:04:42 +01:00
Sam Leonard
1ad9752260 vmspawn: fix incorrect handling of -M in getopt_long 2024-02-08 16:04:42 +01:00
Sam Leonard
a759d3239d vmspawn: fix incorrect mention of container 2024-02-08 16:04:42 +01:00
Yu Watanabe
738ad08b0d copy: do not ignore chattr_flags and friends passed to copy_file_atomic_full()
Fixes a bug introduced by 427d9c34e61a8f5bfe369f1d5a0426143fe5741e.
2024-02-08 22:06:16 +09:00
Yu Watanabe
8334b1c762
Merge pull request #31245 from yuwata/network-ndisc-adjust-log-messages
network/ndisc: slightly update log messages
2024-02-08 22:05:55 +09:00
Yu Watanabe
e2382ef005 wait-online: split out get_state_range()
Follow-up for 2d708781620239c9d1f9828a39f8761acf6350b2.

After the conversion from FOREACH_POINTER() to FOREACH_ARGUMENT(),
the iterator is never set to POINTER_MAX.
2024-02-08 16:59:04 +08:00
Sludge
02c127b344 hwdb: add resolution setting for GAOMON S620 2024-02-08 13:12:10 +09:00
Yu Watanabe
1847a544af dissect-image: fix typo
Follow-up for b387778c5b8a1e0d1b3f957f0c5866defbfbe4d4.
2024-02-08 11:37:20 +09:00
Yu Watanabe
5ac0345329 nspawn: fix typo
Follow-up for f94025a13681e001011dd52e0dcecc143b4501b9.
2024-02-08 11:36:08 +09:00
Yu Watanabe
d9b8acda2a test: fix typo
Follow-up for 38a80ba1089fcad427f4376e28f74f9eb630fb91 and
a39d8396a986cb6291486b1d8451de8b0fd2b6cc.
2024-02-08 11:34:36 +09:00
Yu Watanabe
155d7a2c04 network/ndisc: drop onlink prefix route when on-link flag is zero
Fixes #28435.
2024-02-08 11:30:19 +09:00
Yu Watanabe
a8b0b84822 network/ndisc: fix use-of-uninitialized-value on failure path
Fixes a bug in f44eebd1bab9327c5dd3a281196bd07192134d3b.

Also slightly adjust log message.
2024-02-08 11:30:07 +09:00
Yu Watanabe
0627b29e0a
Merge pull request #31171 from yuwata/sd-ndisc-invalid-dnssl
sd-ndisc: handle invalid DNSSL option gracefully
2024-02-08 09:10:38 +09:00
Yu Watanabe
7dc431839e network/dhcp4: disable IPv6OnlyMode= by default
As explained in #30891, IPv6OnlyMode= should be enabled with 464XLAT
support, but we do not support it yet. Let's disable by default.

Fixes #30891.
2024-02-07 23:30:17 +00:00
Yu Watanabe
a39d8396a9 test: add test case for invalid DNSSL option 2024-02-08 06:46:48 +09:00
Yu Watanabe
b409ac6c77 network/ndisc: sd_ndisc_router_get_{icmp6_ratelimit,retransmission_time}() should never fail
This also fixes use of '%m' specifier without passign error code.
2024-02-08 06:24:31 +09:00
Yu Watanabe
34acdf9074 network/ndisc: slightly adjust log messages 2024-02-08 06:24:31 +09:00
Yu Watanabe
38a80ba108 test: add short comment for RA message 2024-02-08 05:39:21 +09:00
Yu Watanabe
6244184e3f sd-ndisc: make sd_ndisc_router_dnssl_get_domains() return -EBADMSG when received invalid domain name
Fixes #31168.
2024-02-08 05:39:21 +09:00
Yu Watanabe
3092bd7aa1
Merge pull request #31176 from yuwata/network-required-for-online
network: adjust default value of RequiredForOnline=
2024-02-08 05:26:12 +09:00
Fernando Fernandez Mancera
5c9afd93a9 sd-dhcp6-client: allow setting send-release when client is running
The send-release option only affects to the client when STOPPING. There
is no reason to do not allow this option to be set while the client is
running.

An user might want to delay the decision of sending a RELEASE message to
a later stage where the client is already running.
2024-02-08 05:24:20 +09:00
Keian
e23d7aa193
60-evdev.hwdb: Add support for Huion Inspiroy 2 L (#31241)
Also fixed a spelling mistake on the HUION Inspiroy H420X
2024-02-08 04:14:09 +08:00
Frantisek Sumsal
14ce9b4ed8 process-util: unify the hex value format a bit
And fix the man page reference as well.
2024-02-07 19:29:53 +01:00
Frantisek Sumsal
3dc51ab2cf process-util: use only the least significant byte from personality()
The personality() syscall returns a 32-bit value where the top three
bytes are reserved for flags that emulate historical or architectural
quirks, and only the least significant byte reflects the actual
personality we're interested in (in opinionated_personality()).

Use the newly defined mask in the corresponding test as well, otherwise
the test fails on some more "exotic" architectures that set some of the
"quirk" flags:

~# uname -m
armv7l
~# build/test-seccomp
...
/* test_lock_personality */
current personality=0x0
safe_personality(PERSONALITY_INVALID)=0x800000
Assertion '(unsigned long) safe_personality(current) == current' failed at src/test/test-seccomp.c:970, function test_lock_personality(). Aborting.
lockpersonalityseccomp terminated by signal ABRT.
Assertion 'wait_for_terminate_and_check("lockpersonalityseccomp", pid, WAIT_LOG) == EXIT_SUCCESS' failed at src/test/test-seccomp.c:996, function test_lock_personality(). Aborting.
Aborted (core dumped)

See: personality(2) and comments in sys/personality.h
2024-02-07 19:29:53 +01:00
Yu Watanabe
fe0acbf7e0 network: set 'removing' flag to remembered object
Previously, if address_remove() or friends called with a temporary
object, the removing flag is assigned to the temporary object, and is
not set to the remembered object. Hence, e.g.
route_is_ready_to_configure() wrongly judge a required address for a
route is (still) ready, hence networkd fails to configure the route.

Fixes #28009.
2024-02-07 10:25:19 +00:00
Yu Watanabe
10aedb6f9d network/address: do not configure with IFA_F_TENTATIVE
Follow-up for 0a0c2672dbd22dc85d660e5baa7e1bef701beb88.

After the commit, remembered Address objects by Link are always given by
kernel. Hence, it is not necessary to set the flag, as it is always
ignored by the kernel, and the kernel set the flag on notification if it
is necessary.
2024-02-07 10:21:12 +00:00
Luca Boccassi
9182658d3b
Merge pull request #31202 from YHNdnzj/creds-reuse
core: reuse credential dir across start and start-post if populated
2024-02-07 10:17:07 +00:00
Franck Bui
e374109efb test: systemd-update-utmp is optional
It can be disabled with '-Dutmp=false'
2024-02-07 11:00:20 +01:00
Maanya Goenka
34e17203bd
preset: enable confext and sysext by default (#31211) 2024-02-07 04:19:59 +08:00
Zbigniew Jędrzejewski-Szmek
d44934f378 NEWS: announce plan to drop support for nscd
This is in preparation for https://github.com/systemd/systemd/pull/30360 to be
merged in a future release. As described there:

  nscd is known to be racy [1] and it was already deprecated and later dropped
  in Fedora a while back [1,2]. We don't need to support obsolete stuff in
  systemd, and the cache in systemd-resolved provides a better solution anyway.

  [1] https://fedoraproject.org/wiki/Changes/DeprecateNSCD
  [2] https://fedoraproject.org/wiki/Changes/RemoveNSCD

Note that our "support" is only the signal to flush the cache that we send at
various points. Nscd itself may still exist, dropping it is a decision to be
made in glibc.
2024-02-06 18:34:56 +01:00
Mike Yuan
cfbf7538d8
core: reuse credential dir across start and start-post if populated,
fresh otherwise

Currently, exec_setup_credential() always rewrite all credentials
upon exec_invoke(), i.e. invocation of each ExecCommand, and within
a single tmpfs instance. This is problematic though:

* When writing each tmp cred file, we essentially double the size
  of the credential. Therefore, if one cred is bigger than half
  of CREDENTIALS_TOTAL_SIZE_MAX, confusing ENOSPC occurs (see also
  https://github.com/systemd/systemd/pull/24734#issuecomment-1925440546)

* Credential is a unit-wide thing and thus should not change
  during the whole lifetime of main process. However, if e.g.
  a on-disk credential or SetCredential= in unit file
  changes between ExecStart= and ExecStartPost=,
  the credentials are overwritten when the latter gets to run,
  and the already-running main process is suddenly seeing
  completely different creds.

So, let's try to reuse final cred dir if the main process has started
and the tmpfs has been populated, so that the creds used is stable
across all ExecStart= and ExecStartPost=-s. We still want to retain
the ability of updating creds through ExecStartPre= though, therefore
we forcibly use a fresh cred dir for those. 'Fresh' means to actually
unmount the old tmpfs first, so the first problem goes away, too.
2024-02-07 00:43:33 +08:00
Mike Yuan
1221ba0f6f
core: introduce exec_params_need_credentials
Also rename EXEC_WRITE_CREDENTIALS to EXEC_SETUP_CREDENTIALS.
2024-02-07 00:43:33 +08:00
Mike Yuan
54c3546188
TEST-54-CREDS: add test for ExecStartPost= (#31194) 2024-02-07 00:43:32 +08:00
Mike Yuan
0f781376c0
core/exec-credential: use FOREACH_ARRAY at one more place 2024-02-07 00:43:32 +08:00
Mike Yuan
3a0f6c217d
core/exec-credential: add missing assertions 2024-02-07 00:43:32 +08:00
Yu Watanabe
6f412c00cf wait-online: by default not all interface need to be online
Fixes an issue caused by ab3aed4a0349bbaa26f53340770c1b59b463e05d (v253).

By default, all managed interface need to be configured, and at least
one interface need to be online. Hence, offline interface should be ignored.

Fixes #29506.
2024-02-06 12:45:37 +00:00
Felix Riemann
0119370cbb cryptenroll: Fix reading keyfile from socket
systemd-cryptenroll uses the READ_FULL_FILE_CONNECT_SOCKET flag when
reading the keyfile to also allow reading it from a socket. But it also
sets the offset to 0, causing an unnecessary seek to the beginning of
the newly opened keyfile and disables socket support again, as these do
not support seeking.

Disable seeking entirely to remove the unneeded seek and restore support
for reading the keyfile from a socket again as with systemd-cryptsetup.
2024-02-06 12:44:42 +00:00
Luca Boccassi
d50f58d641
Merge pull request #31210 from poettering/chdir-hardening
WorkingDirectory= hardening
2024-02-06 12:41:43 +00:00
Luca Boccassi
33d7fedca9
Merge pull request #31205 from YHNdnzj/path-is-mount-point
mountpoint-util: expose root and flags as path_is_mount_point_full
2024-02-06 12:37:20 +00:00
Zbigniew Jędrzejewski-Szmek
85a84772a1 units: drop userdbd from homed's Also=
Also= lists units which should be enabled/disabled together with the first unit.
But userdbd is independent of homed, we shouldn't e.g. disable it even if homed
is disabled.
2024-02-06 12:36:04 +00:00
Mike Yuan
c90335403c process-util: minor follow-up for pidfd_spawn 2024-02-06 12:26:38 +00:00