Commit Graph

9545 Commits

Author SHA1 Message Date
Yu Watanabe
fe94aa316d network/tunnel: make sit and ipip tunnel support Mode= setting
Closing #37377.
2025-06-16 17:01:20 +09:00
Yu Watanabe
8424a70caf network/tunnel: rename Ip6TnlMode to TunnelMode
This also makes ip6tnl can be created without specifying Mode= setting,
as the kernel accepts new-link netlink message without the
IFLA_IPTUN_PROTO attribute.

No effective functional change, just refactoring and preparation for
later change.
2025-06-16 16:58:38 +09:00
Mike Yuan
a14a6f1df6 socket-activate: add a --now option to instantly start service (#37620) 2025-06-16 02:08:57 +02:00
Colin Foster
0dbb5139a7 network/dhcp4: add ability to use BOOTP
Add the following network option to enable BOOTP:

[DHCPv4]
Bootp=yes

This will allow a two message request / reply sequence that doesn't
require DHCP message types.

Co-authored-by: Avram Dorfman <dorfman@est.org>
2025-06-13 14:15:04 +09:00
Yu Watanabe
6f5958c74d man/machinectl: underscore is not allowed in machine name
Fixes #27481.
2025-06-11 22:41:53 +09:00
Luke Yeager
9217a6ffa3 man: fix typo in dns-delegate example 2025-06-11 12:47:21 +09:00
Dan Streetman
103fa98f84 keyutil: add parameter to specify hash algorithm used for PKCS#1 signature 2025-06-10 08:45:31 -04:00
Daniel Foster
9e940164e9 socket-activate: add --now option
Add a --now option that starts the program instantly, instead of waiting for a
connection on the socket. This is useful, for instance, when developing:

Say I have a Rust, socket-activated web service. I can test it with:
systemd-socket-activate -l 8080 --fdname=http cargo run

However this delays running the service (which potentially involves compilation)
to when I try to connect to it, which wastes time. Since it delays compilation,
I also don't see any warning or errors in the code until it gets a connection
either.

The name's now a bit of a misnomer, since starting the service immediately isn't
really socket activation, but oh well ¯\_(ツ)_/⁻
2025-06-10 13:38:33 +10:00
Lennart Poettering
790f516217 machined: open up machine registration for unpriv clients also via D-Bus
This is already opened up via Varlink. Let's also open it up via D-Bus
with the same polikit operation.
2025-06-07 00:27:11 +02:00
Lennart Poettering
ac8c558629 nspawn: start polkit agent while we do polkit operations
Let's make sure unpriv nspawn can acquire privs even when invoked
outside of a desktop environment that has a polkit agent registered.
2025-06-06 22:14:50 +02:00
Lennart Poettering
c91f1a3db8 man: suggest using --unlock-tpm2-device=auto in cryptenroll example
When refreshing a tpm2 enrollment, it makes sense to use tpm2 to unlock
the device.

Fixes: #35279
2025-06-05 14:10:32 +01:00
Lennart Poettering
4bd37b94b8 fixes for --machine= handling in run0 and journalctl (#37741)
Fixes: #32997
2025-06-05 14:02:26 +02:00
Lennart Poettering
020d6c1dce machined: open up OpenMachinePTY() for unpriv clients
The method call already does a PK check, it was just forgotten to
allowlist this in the dbus policy. And in the dbus vtable for
OpenMachinePTY() call. (It was allowlisted in the per-machine
vtable…)

Anyway, clean this up.
2025-06-05 12:44:08 +02:00
Lennart Poettering
317054365e man: reword --raw= explanation a bit
Explain what we mean by "payload", and for which RR types this is
intended.

And don#t claim we'd output a full packet, because we don't. We output
only the RR in binary.

Fixes: #37737
2025-06-05 12:38:28 +02:00
Mike Yuan
46b0844743 sd-daemon: add sd_pidfd_get_inode_id()
We nowadays expose pidfdid at various places, e.g. envvars
and dbus properties. Also the sd_notify() MAINPID= message
has been complemented with MAINPIDFDID=. But acquiring
pidfdid is actually non-trivial especially considering
the 32-bit case, hence let's introduce a public helper
in sd-daemon specifically for that purpose.
2025-06-05 01:35:08 +02:00
Mike Yuan
dbb28f7b24 man/sd_pid_get_owner_uid: don't limit -EBADF to socket fds 2025-06-05 00:28:01 +02:00
Yu Watanabe
b525942037 man/pcrlock: fix typo
Follow-up for ccd2bf48b2.
2025-06-04 13:13:14 +09:00
Lennart Poettering
1144f07dc6 measure: generate a more useful error in case SHA1 support is disabled by distro
Fixes: #36743
2025-06-03 16:12:45 +02:00
Lennart Poettering
ccd2bf48b2 pcrlock: add "is-supported" verb that checks if the local TPM supports the commands we need for pcrlock
systemd-pcrlock requires support for the PolicyAuthorizeNV command,
which is not implemented in the first TPM2 releases. We also strictly
require SHA-256 support. Hence add a tool for checking for both of
these.

This is a tighter version of "systemd-analyze has-tpm2", that checks for
the precise feature that systemd-pcrlock needs, on top of basic TPM2
functionality.

Fixes: #37607
2025-06-03 16:12:45 +02:00
Anton Ryzhov
bd02e15710 man/systemd-creds: fix documentation typo in systemd.exec.xml 2025-06-03 07:42:44 +09:00
Lennart Poettering
a9de5d7d84 man: emphasize that systemd-userdb-load-credentials.service doesn't do UID/GID allocation 2025-06-02 15:16:31 +02:00
Lennart Poettering
c5fcf4ab59 man: add reference from userdbctl man page to nss-systemd regarding user record drop-ins 2025-06-02 15:16:31 +02:00
Lennart Poettering
c4c0307f53 man: mention systemd-userdb-load-credentials.service when discussing /run/userdb/ drop-ins 2025-06-02 15:16:31 +02:00
Yu Watanabe
0436240dd2 udevadm: allow to specify device by device ID (#37636) 2025-06-02 18:02:36 +09:00
Christian Glombek
0af9937691 portable,sysext: match extension OS ID also against host ID_LIKE 2025-05-31 10:02:11 +09:00
Shubhendra Kushwaha
2948f981dd docs: add man page for sd_device_enumerator_get_device_first() and friends
For #20929.
2025-05-31 04:40:33 +09:00
Zbigniew Jędrzejewski-Szmek
505a5d2bcd Merge remote-tracking branch 'systemd-security/coredump-d' 2025-05-29 17:22:19 +02:00
Shubhendra Kushwaha
fbad1beae4 docs: add man pages for sd_device_enumerator_add_match_* (#37589)
Add man pages for:
- `sd_device_enumerator_add_all_parents`
- `sd_device_enumerator_add_match_parent`
- `sd_device_enumerator_add_match_property`
- `sd_device_enumerator_add_match_property_required`
- `sd_device_enumerator_add_match_subsystem`
- `sd_device_enumerator_add_match_sysattr`
- `sd_device_enumerator_add_match_sysname`
- `sd_device_enumerator_add_match_tag`
- `sd_device_enumerator_add_nomatch_sysname`
- `sd_device_enumerator_allow_uninitialized`.

Related to #20929
2025-05-29 18:40:18 +09:00
Luca Boccassi
868d95577e coredump: add support for new %F PIDFD specifier
A new core_pattern specifier was added, %F, to provide a PIDFD
to the usermode helper process referring to the crashed process.
This removes all possible race conditions, ensuring only the
crashed process gets inspected by systemd-coredump.
2025-05-29 00:10:55 +02:00
Zbigniew Jędrzejewski-Szmek
0c49e0049b coredump: use %d in kernel core pattern
The kernel provides %d which is documented as
"dump mode—same as value returned by prctl(2) PR_GET_DUMPABLE".

We already query /proc/pid/auxv for this information, but unfortunately this
check is subject to a race, because the crashed process may be replaced by an
attacker before we read this data, for example replacing a SUID process that
was killed by a signal with another process that is not SUID, tricking us into
making the coredump of the original process readable by the attacker.

With this patch, we effectively add one more check to the list of conditions
that need be satisfied if we are to make the coredump accessible to the user.

Reportedy-by: Qualys Security Advisory <qsa@qualys.com>

In principle, %d might return a value other than 0, 1, or 2 in the future.
Thus, we accept those, but emit a notice.
2025-05-29 00:10:08 +02:00
Yu Watanabe
d0ba749e8c udevadm: allow to specify device by device ID
We have already exposed device ID in the output of device ID in J
fields. Also sd_device_get_device_id() and sd_device_new_from_device_id()
are already public. Hence, making udevadm accept device IDs may be
useful.

With this change, as we save several data in /run/udev with device ID,
we can call udevadm something like the following:
```
udevadm info $(ls /run/udev/tags/uaccess)
```
Then, we can show all devices that has uaccess tag.
2025-05-29 04:04:22 +09:00
Yu Watanabe
6a907a00be man/udevadm: update command arguments 2025-05-29 04:04:22 +09:00
Jan Čermák
c9f931b737 journal-gatewayd: add /boots endpoint (#37574)
Add endpoint for listing boots. Output format mimics `journalctl
--list-boots -o json`, so it's a plain array containing index, boot ID
and timestamps of the first and last entry. Initial implementation
returns boots ordered starting with the current one and doesn't allow
any filtering (i.e. equivalent of --lines argument).

Fixes: #37573
2025-05-29 03:33:03 +09:00
Zbigniew Jędrzejewski-Szmek
b082968d19 man: better tags, more links, minor grammar and formatting improvements
Closes https://github.com/systemd/systemd/issues/35751.
2025-05-28 15:35:53 +02:00
Zbigniew Jędrzejewski-Szmek
acf3bdf813 man/systemd.network: reword description of MulticastIGMPVersion= 2025-05-28 15:34:47 +02:00
Zbigniew Jędrzejewski-Szmek
f56d9b82b1 man/systemd.timer: change to positive wording 2025-05-28 15:34:47 +02:00
Zbigniew Jędrzejewski-Szmek
de8d2894b8 man: reword descriptions of numerical fields
A "string" is a concept in C. In a text-based API, this is implicit, especially
if we say that something was "formatted". So change occurences of "decimal
string" to just "decimal". Similarly, "numerics" is unclear, say "digits".

Also, a "timestamp is in a clock" just sounds wrong. Reword those sentences.
2025-05-28 15:34:47 +02:00
Zbigniew Jędrzejewski-Szmek
948369983c man/systemd-resolved: update description of routing 2025-05-28 15:34:47 +02:00
Zbigniew Jędrzejewski-Szmek
8bfdba3cb1 man/systemd-analyze: rewrite "Exit status" section 2025-05-28 15:34:47 +02:00
Zbigniew Jędrzejewski-Szmek
3a23e96b67 man/pam_systemd: use <constant> consistently
For some reason, <constant> and <literal> were used interchangeably.
2025-05-28 15:33:39 +02:00
Zbigniew Jędrzejewski-Szmek
001ae86a73 man: introduce openssl as man page provider and use it for ukify.1 2025-05-28 15:33:39 +02:00
Zbigniew Jędrzejewski-Szmek
976295bf8b repart: Copy fs-verity status for CopyFiles= (#35401)
When populating a filesytem with CopyFiles=, we first copy the files to
a temporary directory. Make sure we use the (new) COPY_FS_VERITY flag
when doing that copy so that the `mkfs` that we invoke can see the files
with fs-verity enabled.

Closes #35352
2025-05-27 14:01:05 +02:00
Lennart Poettering
5c5934c62d mountfsd: add ability to create dir owned by foreign UID range in unpriv $HOME (#37616) 2025-05-27 12:20:05 +02:00
Lennart Poettering
b4c2e2b970 varlinkctl: optionally push fds to server 2025-05-27 10:41:52 +02:00
Lennart Poettering
98fc46f2a6 logind,machined: expose bus properties for leader PID fd ids, too 2025-05-27 10:23:36 +02:00
Allison Karlitskaya
eef63efcc3 repart: add 'fsverity' flag for CopyFiles= lines
We currently pass the CopyFlags that we use to populate the temporary
directory in the form of a constant at each of the copy_tree_at() call
sites.  De-duplicate that and move it into the `CopyFilesLine` struct,
initializing it from the parser.

Add our first non-constant flag: `fsverity=`.  This can be set to `off`
(the default) or `copy`, in which case we copy the fs-verity state from
the source files.

This arrangement is amenable to the introduction of more flags to
`CopyFiles=` lines, if we want to add them in the future.

Update the `repart.d(5)` manpage.

Closes #35352

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
2025-05-27 09:26:02 +02:00
Shubhendra Kushwaha
ac8ed83947 docs: add man pages for sd_device_enumerator_[new,ref,unref,unrefp] (#37586)
For #20929.
2025-05-25 05:01:27 +09:00
Stefan Herbrechtsmeier
29a352e8c1 hostname: add hardware version
Add support for the hardware version. The version describes a distinct
version of compatibility hardware. The value is read from the file
/etc/machine-info or DMI as fallback.

The integration provides an unified interface to collect detail hardware
information. The /etc/machine-info entry enables embedded devices
without UEFI support to read the information from a custom store.
2025-05-22 09:00:14 +02:00
Stefan Herbrechtsmeier
79e9fb68a3 hostname: add hardware Stock-Keeping Unit
Add support for the hardware Stock-Keeping Unit (SKU). The SKU describes
a distinct type of hardware for sale, purchase or inventory management.
The value is read from the file /etc/machine-info or DMI as fallback.

The integration provides an unified interface to collect detail hardware
information. The /etc/machine-info entry enables embedded devices
without UEFI support to read the information from a custom store.
2025-05-22 09:00:14 +02:00
Lennart Poettering
dfc9fd0147 logind: rename EnableWallMessages= configuration knob to WallMessages= (#37553)
We generally frown on config options that are called
EnableXYZ=/DisableXYZ=, hence drop this here too. Note that the original
sin was that the pre-existing D-Bus property already used the prefix.
But given that D-Bus properties are substantially more low-level (i.e.
developer focused) than the config knobs, let's bite the bullet and
name the configuration option cleanly, even if the dbus property carries
the damn prefix.

The knob was added post v257, hence this is not a compat break.

Follow-up for: 130698dc20
2025-05-22 02:47:57 +09:00