]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agosystemd-analyze: add new 'security' option to compare unit's overall exposure level... 20421/head
Maanya Goenka [Tue, 17 Aug 2021 17:40:15 +0000 (10:40 -0700)] 
systemd-analyze: add new 'security' option to compare unit's overall exposure level with

--threshold option added to work with security verb and with the --offline option so that
users can determine what qualifies as a security threat. The threshold set by the user is
compared with the overall exposure level assigned to a unit file and if the exposure is
higher than the threshold, 'security' will return a non-zero exit status. The default value
of the --threshold option is 100.

Example Run:

1. testcase.service is a unit file created for testing the --threshold option

    maanya-goenka@debian:~/systemd (systemd-security)$ cat<<EOF>testcase.service

    > [Service]
    > ExecStart = echo hello
    > EOF

    For the purposes of this demo, the security table outputted below has been cut to show only the first two security settings.

    maanya-goenka@debian:~/systemd (systemd-security)$ sudo build/systemd-analyze security --offline=true testcase.service
    /usr/lib/systemd/system/plymouth-start.service:15: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's
    process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'.
    Support for KillMode=none is deprecated and will eventually be removed.
    /usr/lib/systemd/system/gdm.service:30: Standard output type syslog is obsolete, automatically updating to journal. Please update your
    unit file, and consider removing the setting altogether.
    /usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating
    /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.

      NAME                                        DESCRIPTION                                                       EXPOSURE
    ✗ PrivateNetwork=                             Service has access to the host's network                          0.5
    ✗ User=/DynamicUser=                          Service runs as root user                                         0.4

    → Overall exposure level for testcase.service: 9.6 UNSAFE 😨

    maanya-goenka@debian:~/systemd (systemd-security)$ echo $? 0

2. Next, we use the same testcase.service file but add an additional --threshold=60 parameter. We would expect 'security' to exit
   with a non-zero status because the overall exposure level (= 96) is higher than the set threshold (= 60).

    maanya-goenka@debian:~/systemd (systemd-security)$ sudo build/systemd-analyze security --offline=true --threshold=60 testcase.service
    /usr/lib/systemd/system/plymouth-start.service:15: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's
    process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'.
    Support for KillMode=none is deprecated and will eventually be removed.
    /usr/lib/systemd/system/gdm.service:30: Standard output type syslog is obsolete, automatically updating to journal. Please update your
    unit file, and consider removing the setting altogether.
    /usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating
    /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.

      NAME                                        DESCRIPTION                                                       EXPOSURE
    ✗ PrivateNetwork=                             Service has access to the host's network                          0.5
    ✗ User=/DynamicUser=                          Service runs as root user                                         0.4

    → Overall exposure level for testcase.service: 9.6 UNSAFE 😨

    maanya-goenka@debian:~/systemd (systemd-security)$ echo $? 1

4 years agosystemd-analyze: 'security' option to perform offline reviews of the specified unit...
Maanya Goenka [Tue, 17 Aug 2021 17:25:38 +0000 (10:25 -0700)] 
systemd-analyze: 'security' option to perform offline reviews of the specified unit file(s)

New option --offline which works with the 'security' command and takes in a boolean value. When set to true,
it performs an offline security review of the specified unit file(s). It does not rely on PID 1 to acquire
security information for the files like 'security' when used by itself does. It makes use of the refactored
security_info struct instead (commit #8cd669d3d3cf1b5e8667acc46ba290a9e8a8e529). This means that --offline can be
used with --image and --root as well. When used with --threshold, if a unit's overall exposure level is above
that set by the user, the default value being 100, --offline returns a non-zero exit status.

Example Run:

1. testcase.service is a unit file created for testing the --offline option

maanya-goenka@debian:~/systemd (systemd-security)$ cat<<EOF>testcase.service

> [Service]
> ExecStart = echo hello
> EOF

For the purposes of this demo, the security table outputted below has been cut to show only the first two security settings.

maanya-goenka@debian:~/systemd (systemd-security)$ sudo build/systemd-analyze security --offline=true testcase.service
/usr/lib/systemd/system/plymouth-start.service:15: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's
process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'.
Support for KillMode=none is deprecated and will eventually be removed.
/usr/lib/systemd/system/gdm.service:30: Standard output type syslog is obsolete, automatically updating to journal. Please update your
unit file, and consider removing the setting altogether.
/usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating
/var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.

  NAME                                        DESCRIPTION                                                       EXPOSURE
✗ PrivateNetwork=                             Service has access to the host's network                          0.5
✗ User=/DynamicUser=                          Service runs as root user                                         0.4

→ Overall exposure level for testcase.service: 9.6 UNSAFE 😨

maanya-goenka@debian:~/systemd (systemd-security)$ echo $? 0

2. The testcase.service unit file is modified to set PrivateNetwork to "yes". This reduces the exposure level from 9.6 to 9.1.

maanya-goenka@debian:~/systemd (systemd-security)$ nano testcase.service

> [Service]
> ExecStart = echo hello
> PrivateNetwork = yes
> EOF

maanya-goenka@debian:~/systemd (systemd-security)$ sudo build/systemd-analyze security --offline=true testcase.service
/usr/lib/systemd/system/plymouth-start.service:15: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's
process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'.
Support for KillMode=none is deprecated and will eventually be removed.
/usr/lib/systemd/system/gdm.service:30: Standard output type syslog is obsolete, automatically updating to journal. Please update your
unit file, and consider removing the setting altogether.
/usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating
/var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.

  NAME                                        DESCRIPTION                                                       EXPOSURE
✓ PrivateNetwork=                             Service has access to the host's network
✗ User=/DynamicUser=                          Service runs as root user                                         0.4

→ Overall exposure level for testcase.service: 9.1 UNSAFE 😨

maanya-goenka@debian:~/systemd (systemd-security)$ echo $? 0

3. Next, we use the same testcase.service unit file but add the additional --threshold=60 option to see how --threshold works with
--offline. Since the overall exposure level is 91 which is greater than the threshold value set by the user (= 60), we can expect
a non-zero exit status.

maanya-goenka@debian:~/systemd (systemd-security)$ sudo build/systemd-analyze security --offline=true --threshold=60 testcase.service
/usr/lib/systemd/system/plymouth-start.service:15: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's
process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'.
Support for KillMode=none is deprecated and will eventually be removed.
/usr/lib/systemd/system/gdm.service:30: Standard output type syslog is obsolete, automatically updating to journal. Please update your
unit file, and consider removing the setting altogether.
/usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating
/var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.

  NAME                                        DESCRIPTION                                                       EXPOSURE
✓ PrivateNetwork=                             Service has access to the host's network
✗ User=/DynamicUser=                          Service runs as root user                                         0.4

→ Overall exposure level for testcase.service: 9.1 UNSAFE 😨

maanya-goenka@debian:~/systemd (systemd-security)$ echo $? 1

4 years agosystemd-analyze: refactor security_info to make use of existing struct variables
Maanya Goenka [Tue, 10 Aug 2021 21:00:23 +0000 (14:00 -0700)] 
systemd-analyze: refactor security_info to make use of existing struct variables

In the original implementation of the security_info struct, the struct variables receive its values
via dbus protocol. We want to make use of existing structs ExecContext, Unit, and CGroupContext to
assign values to the security_info variables instead of relying on dbus for the same. This is possible since these
pre-defined structs already contain all the variables that security_info needs to perform security reviews on
unit files that are passed to it in the command line.

4 years agoset: modify the previously incorrect definition of set_copy and add test for it
Maanya Goenka [Mon, 16 Aug 2021 22:55:51 +0000 (15:55 -0700)] 
set: modify the previously incorrect definition of set_copy and add test for it

4 years agoMerge pull request #20488 from yuwata/timesync-fix
Lennart Poettering [Fri, 20 Aug 2021 11:34:20 +0000 (13:34 +0200)] 
Merge pull request #20488 from yuwata/timesync-fix

timesync: fix wrong type for receiving timestamp in nanoseconds

4 years agoMerge pull request #20490 from poettering/id128-format-compound-literal
Lennart Poettering [Fri, 20 Aug 2021 11:33:51 +0000 (13:33 +0200)] 
Merge pull request #20490 from poettering/id128-format-compound-literal

compound literal love for sd_id128_to_string()

4 years agosrc/boot/efi/linux: fix linux_exec prototype
Alfonso Sánchez-Beato [Thu, 19 Aug 2021 10:21:12 +0000 (12:21 +0200)] 
src/boot/efi/linux: fix linux_exec prototype

Callers to linux_exec() are actually passing an EFI_HANDLE, not a pointer to
it. linux_efi_handover(), which is called by linux_exec(), also expects an
EFI_HANDLE.

4 years agotree-wide: port everything over to new sd-id128 compund literal bliss 20490/head
Lennart Poettering [Fri, 20 Aug 2021 08:54:49 +0000 (10:54 +0200)] 
tree-wide: port everything over to new sd-id128 compund literal bliss

4 years agosd-id128: add compound literal love to sd_id128_to_string() + id128_to_uuid_string()
Lennart Poettering [Fri, 20 Aug 2021 08:51:53 +0000 (10:51 +0200)] 
sd-id128: add compound literal love to sd_id128_to_string() + id128_to_uuid_string()

4 years agoman: reference getrandom(2) instead of urandom from sd_id128_randomize() page
Lennart Poettering [Fri, 20 Aug 2021 08:53:23 +0000 (10:53 +0200)] 
man: reference getrandom(2) instead of urandom from sd_id128_randomize() page

It's 2021, /dev/urandom is mostly a thing of the past now.

4 years agoman: document SD_ID128_ALLF
Lennart Poettering [Fri, 20 Aug 2021 08:52:55 +0000 (10:52 +0200)] 
man: document SD_ID128_ALLF

4 years agoman: re-run ninja -C update-man-rules
Lennart Poettering [Fri, 20 Aug 2021 09:09:32 +0000 (11:09 +0200)] 
man: re-run ninja -C update-man-rules

4 years agonetwork: add UseMTU= in [IPv6AcceptRA]
Yu Watanabe [Fri, 20 Aug 2021 00:41:34 +0000 (09:41 +0900)] 
network: add UseMTU= in [IPv6AcceptRA]

Note that kernel has similar knob in sysctl: accept_ra_mtu.

Closes #18868.

4 years agoMerge pull request #18385 from kinvolk/mauricio/restrict-network-interfaces
Lennart Poettering [Fri, 20 Aug 2021 01:41:11 +0000 (03:41 +0200)] 
Merge pull request #18385 from kinvolk/mauricio/restrict-network-interfaces

Add RestrictNetworkInterfaces=

4 years agoicmp6: drop unnecessary assertion 20488/head
Yu Watanabe [Thu, 19 Aug 2021 23:44:27 +0000 (08:44 +0900)] 
icmp6: drop unnecessary assertion

Follow-up for 3691bcf3c5eebdcca5b4f1c51c745441c57a6cd1.

4 years agotimesync: fix wrong type for receiving timestamp in nanoseconds
Yu Watanabe [Thu, 19 Aug 2021 23:40:11 +0000 (08:40 +0900)] 
timesync: fix wrong type for receiving timestamp in nanoseconds

Fixes #20482.

4 years agoudev: Add support for configuring nic coalescing settings
Daan De Meyer [Wed, 18 Aug 2021 12:52:00 +0000 (13:52 +0100)] 
udev: Add support for configuring nic coalescing settings

These are configured via the corresponding ethtool ioctl.

4 years agoMerge pull request #20486 from DaanDeMeyer/sd-bus-eproto
Luca Boccassi [Thu, 19 Aug 2021 22:32:34 +0000 (23:32 +0100)] 
Merge pull request #20486 from DaanDeMeyer/sd-bus-eproto

sd-bus: Return detailed (sd-buscntr) error from bus_container_connect_socket().

4 years agoMerge pull request #20436 from fbuihuu/add-no-build-support-on-opensuse
Luca Boccassi [Thu, 19 Aug 2021 20:11:31 +0000 (21:11 +0100)] 
Merge pull request #20436 from fbuihuu/add-no-build-support-on-opensuse

Add no build support on opensuse

4 years agosd-bus: Improve (sd-buscntr) error logging 20486/head
Daan De Meyer [Thu, 19 Aug 2021 14:09:44 +0000 (15:09 +0100)] 
sd-bus: Improve (sd-buscntr) error logging

We're only doing one thing in the child process which is connecting
to the D-Bus socket so let's mention that in the error message when
something goes wrong instead of having a generic error message.

4 years agosd-bus: Return detailed (sd-buscntr) error from bus_container_connect_socket()
Daan De Meyer [Thu, 19 Aug 2021 14:09:34 +0000 (15:09 +0100)] 
sd-bus: Return detailed (sd-buscntr) error from bus_container_connect_socket()

Previously, when the connect() call in (sd-buscntr) failed, we returned
-EPROTO without ever reading the actual errno from the error pipe. To fix
the issue, delay checking the process exit status until after we've read
and processed any error from the error pipe.

4 years agoMerge pull request #19797 from oniko/systemd-fido2-pkcs11-plugins
Lennart Poettering [Thu, 19 Aug 2021 14:37:55 +0000 (16:37 +0200)] 
Merge pull request #19797 from oniko/systemd-fido2-pkcs11-plugins

Add support for remaining systemd fido2 and pkcs11 libcryptsetup plugins

4 years agoMerge pull request #20471 from poettering/format-str-proc-fd
Luca Boccassi [Thu, 19 Aug 2021 13:05:22 +0000 (14:05 +0100)] 
Merge pull request #20471 from poettering/format-str-proc-fd

add FORMAT_PROC_FD_PATH() macro for generating /proc/self/fd/ paths on-the-fly

4 years agoREADME: add requirements for RestrictNetworkInterfaces= 18385/head
Mauricio Vásquez [Tue, 13 Jul 2021 16:03:31 +0000 (11:03 -0500)] 
README: add requirements for RestrictNetworkInterfaces=

Signed-off-by: Mauricio Vásquez <mauricio@kinvolk.io>
4 years agosystemctl: show RestrictNetworkInterfaces= in systemctl show
Mauricio Vásquez [Thu, 21 Jan 2021 16:20:16 +0000 (11:20 -0500)] 
systemctl: show RestrictNetworkInterfaces= in systemctl show

Signed-off-by: Mauricio Vásquez <mauricio@kinvolk.io>
4 years agotests: add integration test for RestrictNetworkInterfaces=
Mauricio Vásquez [Fri, 26 Feb 2021 00:59:36 +0000 (19:59 -0500)] 
tests: add integration test for RestrictNetworkInterfaces=

Signed-off-by: Mauricio Vásquez <mauricio@kinvolk.io>
4 years agoAdd support for systemd-pkcs11 libcryptsetup plugin. 19797/head
Ondrej Kozina [Thu, 20 May 2021 13:37:08 +0000 (15:37 +0200)] 
Add support for systemd-pkcs11 libcryptsetup plugin.

Add support for systemd-pkcs11 based LUKS2 device activation
via libcryptsetup plugin. This make the feature (pkcs11 sealed
LUKS2 keyslot passphrase) usable from both systemd utilities
and cryptsetup cli.

The feature is configured via -Dlibcryptsetup-plugins combo
with default value set to 'auto'. It get's enabled automatically
when cryptsetup 2.4.0 or later is installed in build system.

4 years agopkcs11-util: split pkcs11_token_login function
Ondrej Kozina [Fri, 4 Jun 2021 14:21:30 +0000 (16:21 +0200)] 
pkcs11-util: split pkcs11_token_login function

Future systemd-pkcs11 plugin requires unlock via single
call with supplied pin. To reduce needless code duplication
in plugin itself split original pkcs_11_token_login call in
two calls:

new pkcs11_token_login_by_pin and the former where loop
for retrying via PIN query callback remains.

4 years agocryptsetup-pkcs11: move pkcs11_callback and data in shared utils.
Ondrej Kozina [Wed, 2 Jun 2021 16:45:42 +0000 (18:45 +0200)] 
cryptsetup-pkcs11: move pkcs11_callback and data in shared utils.

To be used later by both (future) systemd-pkcs11 libcryptsetup
plugin and cryptsetup-pkcs11.

4 years agoAdd support for systemd-fido2 libcryptsetup plugin.
Ondrej Kozina [Mon, 17 May 2021 13:26:14 +0000 (15:26 +0200)] 
Add support for systemd-fido2 libcryptsetup plugin.

Add support for systemd-fido2 based LUKS2 device activation
via libcryptsetup plugin. This make the feature (fido2 sealed
LUKS2 keyslot passphrase) usable from both systemd utilities
and cryptsetup cli.

The feature is configured via -Dlibcryptsetup-plugins combo
with default value set to 'auto'. It get's enabled automatically
when cryptsetup 2.4.0 or later is installed in build system.

4 years agopo: Translated using Weblate (Sinhala)
Hela Basa [Thu, 19 Aug 2021 07:04:49 +0000 (09:04 +0200)] 
po: Translated using Weblate (Sinhala)

Currently translated at 0.5% (1 of 189 strings)

Co-authored-by: Hela Basa <r45xveza@pm.me>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/si/
Translation: systemd/main

4 years agocreds-util: fix possible divide-by-zero
Yu Watanabe [Wed, 18 Aug 2021 07:05:02 +0000 (16:05 +0900)] 
creds-util: fix possible divide-by-zero

input_size may be zero.

Fixes #20469.

4 years agotree-wide: port things over to FORMAT_PROC_FD_PATH() 20471/head
Lennart Poettering [Wed, 18 Aug 2021 07:43:25 +0000 (09:43 +0200)] 
tree-wide: port things over to FORMAT_PROC_FD_PATH()

4 years agotest: add test for FORMAT_PROC_FD_PATH()
Lennart Poettering [Wed, 18 Aug 2021 07:43:19 +0000 (09:43 +0200)] 
test: add test for FORMAT_PROC_FD_PATH()

4 years agofd-util: add macro for generating /proc/self/fd/ paths on the fly
Lennart Poettering [Wed, 18 Aug 2021 07:43:07 +0000 (09:43 +0200)] 
fd-util: add macro for generating /proc/self/fd/ paths on the fly

4 years agostdio-util: give snprintf_ok() some love
Lennart Poettering [Wed, 18 Aug 2021 12:03:10 +0000 (14:03 +0200)] 
stdio-util: give snprintf_ok() some love

as per docs snprintf() can fail in which case it returns -1. The
snprintf_ok() macro so far unconditionally cast the return value of
snprintf() to size_t, which would turn -1 to (size_t) INT_MAX,
presumably, at least on 2 complements system.

Let's be more careful with types here, and first check if return value
is positive, before casting to size_t.

Also, while we are at it, let's return the input buffer as return value
or NULL instead of 1 or 0. It's marginally more useful, but more
importantly, is more inline with most of our other codebase that
typically doesn't use booleans to signal success.

All uses of snprintf_ok() don't care for the type of the return, hence
this change does not propagate anywhere else.

4 years agodiscover-image: pass the right fd to fd_getcrtime()
Lennart Poettering [Wed, 18 Aug 2021 20:41:08 +0000 (22:41 +0200)] 
discover-image: pass the right fd to fd_getcrtime()

4 years agosd-boot: Use UEFI provided CRC32
Jan Janssen [Tue, 17 Aug 2021 09:44:21 +0000 (11:44 +0200)] 
sd-boot: Use UEFI provided CRC32

4 years agosrc/test: add restrict network interfaces to test-cgroup-mask
Mauricio Vásquez [Fri, 26 Feb 2021 12:07:44 +0000 (07:07 -0500)] 
src/test: add restrict network interfaces to test-cgroup-mask

Signed-off-by: Mauricio Vásquez <mauricio@kinvolk.io>
4 years agoman: add RestrictNetworkInterfaces= documentation
Mauricio Vásquez [Thu, 21 Jan 2021 20:36:13 +0000 (15:36 -0500)] 
man: add RestrictNetworkInterfaces= documentation

Signed-off-by: Mauricio Vásquez <mauricio@kinvolk.io>
4 years agoDocument RestrictNetworkInterfaces dbus properties
Mauricio Vásquez [Thu, 21 Jan 2021 20:35:33 +0000 (15:35 -0500)] 
Document RestrictNetworkInterfaces dbus properties

Signed-off-by: Mauricio Vásquez <mauricio@kinvolk.io>
4 years agocore: add D-bus properties for RestrictNetworkInterfaces=
Mauricio Vásquez [Thu, 21 Jan 2021 16:29:36 +0000 (11:29 -0500)] 
core: add D-bus properties for RestrictNetworkInterfaces=

Signed-off-by: Mauricio Vásquez <mauricio@kinvolk.io>
4 years agocore: add load fragment implementation for RestrictNetworkInterfaces=
Mauricio Vásquez [Thu, 21 Jan 2021 16:19:07 +0000 (11:19 -0500)] 
core: add load fragment implementation for RestrictNetworkInterfaces=

Signed-off-by: Mauricio Vásquez <mauricio@kinvolk.io>
4 years agocore: implement RestrictNetworkInterfaces=
Mauricio Vásquez [Thu, 21 Jan 2021 16:08:19 +0000 (11:08 -0500)] 
core: implement RestrictNetworkInterfaces=

This commit introduces all the logic to load and attach the BPF
programs to restrict network interfaces when a unit specifying it is
loaded.

Signed-off-by: Mauricio Vásquez <mauricio@kinvolk.io>
4 years agocore: add RestrictNetworkInterfaces= BPF program source code
Mauricio Vásquez [Thu, 21 Jan 2021 15:45:38 +0000 (10:45 -0500)] 
core: add RestrictNetworkInterfaces= BPF program source code

The code is composed by two BPF_PROG_TYPE_CGROUP_SKB programs that
are loaded in the cgroup inet ingress and egress hooks
(BPF_CGROUP_INET_{INGRESS|EGRESS}).

The decision to let a packet pass or not is based on a map that contains
the indexes of the interfaces.

Signed-off-by: Mauricio Vásquez <mauricio@kinvolk.io>
4 years agotest: if haveged is part of initrd it needs to be installed in the image too 20436/head
Franck Bui [Fri, 6 Aug 2021 14:47:32 +0000 (16:47 +0200)] 
test: if haveged is part of initrd it needs to be installed in the image too

Otherwise haveged won't survive when switching root from initrd to host making
haveged service in host fail.

4 years agotest: adapt install_pam() for openSUSE
Franck Bui [Thu, 5 Aug 2021 13:34:37 +0000 (15:34 +0200)] 
test: adapt install_pam() for openSUSE

On openSUSE the default pam config files are shipped in /usr/etc/pam.d.

Also empty password is not allowed by default.

4 years agoRevert "test: adapt TEST-13-NSPAWN-SMOKE for SUSE"
Franck Bui [Tue, 3 Aug 2021 10:18:40 +0000 (12:18 +0200)] 
Revert "test: adapt TEST-13-NSPAWN-SMOKE for SUSE"

This reverts commit 491b736a49fb9d64b0b515aa773297a30c8bab1d.

If the _static_ linked version of busybox is installed, openSUSE doesn't need
any specific code.

A following commit will make sure that the static linked version of busybox is
installed in the busybox container.

4 years agotest: on openSUSE the static linked version of busybox is named "busybox-static"
Franck Bui [Sun, 8 Aug 2021 05:35:04 +0000 (07:35 +0200)] 
test: on openSUSE the static linked version of busybox is named "busybox-static"

4 years agoTEST-13-*: in busybox container sleep(1) takes a delay in seconds only
Franck Bui [Thu, 5 Aug 2021 06:38:27 +0000 (08:38 +0200)] 
TEST-13-*: in busybox container sleep(1) takes a delay in seconds only

4 years agotest: don't try to find BUILD_DIR when NO_BUILD is set
Franck Bui [Tue, 3 Aug 2021 06:44:47 +0000 (08:44 +0200)] 
test: don't try to find BUILD_DIR when NO_BUILD is set

NO_BUILD=1 indicates that we want to test systemd from the local system and not
the one from the local build. Hence there should be no need to call
find-build-dir.sh when NO_BUID=1 especially since it's likely that the script
will fail to find a local build in this case.

This avoids find-build-dir.sh to emit 'Specify build directory with $BUILD_DIR'
message when NO_BUILD=1 and no local build can be found.

This introduces a behavior change though: systemd from the local system will
always be preferred when NO_BUILD=1 even if a local build can be found.

4 years agotest: add support for NO_BUILD=1 on openSUSE
Franck Bui [Tue, 3 Aug 2021 06:18:13 +0000 (08:18 +0200)] 
test: add support for NO_BUILD=1 on openSUSE

4 years agoudev: make RxChannels= or friends also accept "max"
Yu Watanabe [Wed, 18 Aug 2021 07:41:11 +0000 (16:41 +0900)] 
udev: make RxChannels= or friends also accept "max"

Follow-up for 406041b7de767316674eb6a2f98ad466577ce8a4.

Also, this makes
- the settings accept an empty string,
- if the specified value is too large, also use the advertised maximum
  value.
- mention the range of the value in the man page.

4 years agotree-wide: fix typo
Yu Watanabe [Wed, 18 Aug 2021 10:14:31 +0000 (19:14 +0900)] 
tree-wide: fix typo

4 years agodocs: portable services are no longer in preview 20470/head
Luca Boccassi [Tue, 17 Aug 2021 23:00:46 +0000 (00:00 +0100)] 
docs: portable services are no longer in preview

Reword the intro to the document, as portable services are a stable interface
and no longer a preview.

4 years agofstab-generator: Respect nofail when ordering
Vladimir Panteleev [Tue, 17 Aug 2021 18:30:29 +0000 (18:30 +0000)] 
fstab-generator: Respect nofail when ordering

4 years agoFix typo in dbus property name ("OnSuccesJobMode")
Vladimir Panteleev [Tue, 17 Aug 2021 17:56:41 +0000 (17:56 +0000)] 
Fix typo in dbus property name ("OnSuccesJobMode")

4 years agoMerge pull request #20460 from yuwata/udevadm-test-builtin-introduce-action
Yu Watanabe [Wed, 18 Aug 2021 06:59:40 +0000 (15:59 +0900)] 
Merge pull request #20460 from yuwata/udevadm-test-builtin-introduce-action

udevadm: introduce --action option for test-builtin

4 years agoudev: Support "max" string for BufferSize options (#20458)
Daan De Meyer [Wed, 18 Aug 2021 06:59:13 +0000 (07:59 +0100)] 
udev: Support "max" string for BufferSize options (#20458)

"max" indicates the hardware advertised maximum queue buffer size
should be used.

The max sizes can be checked by running `ethtool -g <dev>` (Preset maximums).
Since the buffer sizes can't be set to 0 by users, internally we use 0 to
indicate that the hardware advertised maximum should be used.

4 years agoMerge pull request #20456 from tomty89/man
Yu Watanabe [Wed, 18 Aug 2021 06:58:06 +0000 (15:58 +0900)] 
Merge pull request #20456 from tomty89/man

Adding a few notes in the systemd.network man page

4 years agonetwork: do not assume the highest priority when Priority= is unspecified
Yu Watanabe [Tue, 17 Aug 2021 05:03:19 +0000 (14:03 +0900)] 
network: do not assume the highest priority when Priority= is unspecified

Previously, when Priority= is unspecified, networkd configured the rule with
the highest (=0) priority. This commit makes networkd distinguish the case
the setting is unspecified and one explicitly specified as Priority=0.

Note.
1) If the priority is unspecified on configure, then kernel dynamically picks
   a priority for the rule.
2) The new behavior is consistent with 'ip rule' command.

Replaces #15606.

4 years agoudevadm: introduce -a|--action option for test-builtin command 20460/head
Yu Watanabe [Tue, 17 Aug 2021 14:14:29 +0000 (23:14 +0900)] 
udevadm: introduce -a|--action option for test-builtin command

As net_setup_link builtin requires that a device action is set for the
sd_device object.

4 years agoman: network: mention that RouteMetric= in [DHCPv4] is also applied to the prefix... 20456/head
Tom Yan [Tue, 17 Aug 2021 14:53:49 +0000 (22:53 +0800)] 
man: network: mention that RouteMetric= in [DHCPv4] is also applied to the prefix route

4 years agoman: network: mention that Promiscuous= can be used to set nopromisc for passthru...
Tom Yan [Tue, 17 Aug 2021 14:53:29 +0000 (22:53 +0800)] 
man: network: mention that Promiscuous= can be used to set nopromisc for passthru MACV{LAN,TAP}

4 years agoMerge pull request #20448 from medhefgo/boot
Lennart Poettering [Tue, 17 Aug 2021 14:26:25 +0000 (16:26 +0200)] 
Merge pull request #20448 from medhefgo/boot

sd-boot: UI improvements

4 years agoshell-completion: add missing uevent actions for udevadm
Yu Watanabe [Tue, 17 Aug 2021 14:13:07 +0000 (23:13 +0900)] 
shell-completion: add missing uevent actions for udevadm

4 years agoudevadm: introduce parse_device_action() helper function
Yu Watanabe [Tue, 17 Aug 2021 13:57:04 +0000 (22:57 +0900)] 
udevadm: introduce parse_device_action() helper function

4 years agoudevadm: introduce find_device_with_action() helper function
Yu Watanabe [Tue, 17 Aug 2021 13:46:32 +0000 (22:46 +0900)] 
udevadm: introduce find_device_with_action() helper function

4 years agoMerge pull request #20281 from bluca/ext_release_naming
Lennart Poettering [Tue, 17 Aug 2021 14:06:26 +0000 (16:06 +0200)] 
Merge pull request #20281 from bluca/ext_release_naming

extension-release: allow fallback when image name is mangled after build, improve docs

4 years agodocs: document layered images in PORTABLE_SERVICES.md 20281/head
Luca Boccassi [Fri, 23 Jul 2021 15:07:05 +0000 (16:07 +0100)] 
docs: document layered images in PORTABLE_SERVICES.md

4 years agoman: further document extension-release
Luca Boccassi [Fri, 23 Jul 2021 13:45:38 +0000 (14:45 +0100)] 
man: further document extension-release

4 years agoextension-release: search for other files if expected name not found
Luca Boccassi [Thu, 22 Jul 2021 19:41:34 +0000 (20:41 +0100)] 
extension-release: search for other files if expected name not found

In some cases image names are unpredictable - some orchestrators/deployment
tools like to mangle names to suit their internal formats. In these cases,
the requirement that the extension-release file matches exactly the image
name where it's contained cannot work.

Allow falling back to loading the first regular file which name starts with
'extension-release' located in /usr/lib/extension-release.d/ and tagged with
a user.extension-release.strict extended attribute with a true value, if the
one with the expected name cannot be found.

4 years agoxattr-util: add fgetxattrat_fake_malloc variant
Luca Boccassi [Mon, 16 Aug 2021 14:58:09 +0000 (15:58 +0100)] 
xattr-util: add fgetxattrat_fake_malloc variant

4 years agosd-boot: Draw custom edit cursor 20448/head
Jan Janssen [Sun, 15 Aug 2021 11:44:35 +0000 (13:44 +0200)] 
sd-boot: Draw custom edit cursor

Firmware likes to draw the EFI provided cursor in a weird way that
makes it invisible sometimes. This is even more likely to happen
if unusual colors are picked. It also fails to draw attention to the
user by being very small and not blinking.

Additionally, to make it more clear that we are in edit mode, we
now default to inverting the general default color and use that for
our line edit.

Fixes: #19301
4 years agosd-boot: Add compile-time color support
Jan Janssen [Sat, 14 Aug 2021 12:38:43 +0000 (14:38 +0200)] 
sd-boot: Add compile-time color support

Fixes: #10139
4 years agosd-boot: Improve key bindings
Jan Janssen [Sat, 14 Aug 2021 12:26:12 +0000 (14:26 +0200)] 
sd-boot: Improve key bindings

Making keys case insensitive should help if caps lock is on.
We are not advertising them at runtime or in the manual to
reduce the noise.

This also hides the quit and version commands from the help
string. They are mostly for devs and otherwise have little
to no use to normal users. The latter overlaps with print
status which is still advertised.

4 years agosd-boot: Render title entries centered and not to entire screen width
Jan Janssen [Sat, 14 Aug 2021 12:10:35 +0000 (14:10 +0200)] 
sd-boot: Render title entries centered and not to entire screen width

4 years agosd-boot: Introduce print_at helper function
Jan Janssen [Sat, 14 Aug 2021 12:02:16 +0000 (14:02 +0200)] 
sd-boot: Introduce print_at helper function

4 years agosd-boot: Fix marking EFI var default entry
Jan Janssen [Sat, 14 Aug 2021 11:44:12 +0000 (13:44 +0200)] 
sd-boot: Fix marking EFI var default entry

Fixes: #18072
4 years agoenv-util: add unsetenv_erase() helper
Lennart Poettering [Mon, 16 Aug 2021 14:41:34 +0000 (16:41 +0200)] 
env-util: add unsetenv_erase() helper

Let's unify how we remove secrets from the env block.

4 years agoMerge pull request #20420 from poettering/import-beef-up
Lennart Poettering [Tue, 17 Aug 2021 09:53:18 +0000 (11:53 +0200)] 
Merge pull request #20420 from poettering/import-beef-up

import: modernizations, and various additions

4 years agoimport: drop some now unused functions from import-common.c 20420/head
Lennart Poettering [Fri, 26 Feb 2021 21:49:38 +0000 (22:49 +0100)] 
import: drop some now unused functions from import-common.c

4 years agodocs: document how to turn off btrfs quota support in importd
Lennart Poettering [Wed, 3 Feb 2021 20:50:27 +0000 (21:50 +0100)] 
docs: document how to turn off btrfs quota support in importd

Fixes: #18421 #15903
4 years agoimport-fs: make various options controllable via cmdline/env var
Lennart Poettering [Thu, 25 Feb 2021 12:09:30 +0000 (13:09 +0100)] 
import-fs: make various options controllable via cmdline/env var

This basically does what the previous two commits did for systemd-import
+ systemd-pull but for systemd-import-fs.

This commit is a bit simpler though, as a --direct mode doesn't change
that much. It's mostly about not searching for existing, conflicting
images and not much else.

4 years agopull: add --direct mode + make various eatures optional + explicit checksum verification
Lennart Poettering [Wed, 9 Jun 2021 15:19:15 +0000 (17:19 +0200)] 
pull: add --direct mode + make various eatures optional + explicit checksum verification

This does what the previous commit did for systemd-import the same way
for systemd-pull.

It also adds one more thing: the checksum validation is extended, in
addition of doing SHA256SUMS/gpg verification it is now possible to
immediately specify a hash value on the command line that the download
needs to match. This is particularly useful in --direct mode as we can
download/decompress/unpack arbitrary files and check the hash of the
downloaded file on-the-fly.

4 years agoimport: add new "--direct" mode + add controls for turning certain features on/off
Lennart Poettering [Fri, 22 Jan 2021 16:40:51 +0000 (17:40 +0100)] 
import: add new "--direct" mode + add controls for turning certain features on/off

This reworks/modernizes the tar/raw import logic and adds the following
new features:

- Adds the ability to control btrfs subvol and quota behaviour which was
  previously always on via an env var and cmdline arg

- Adds control whether to sync() stuff after writing it, similar via env
  var + cmdline arg

- Similar, the QCOW2 unpacking logic that was previously the implied
  default may now be controlled via env var + cmdline arg.

- adds a "direct" mode. In this mode, the systemd-import tool can be
  used as a simple tool for decompressing/unpacking/installing arbitrary
  files, without all the additional meta data and auxiliary resources,
  i.e.  outside of the immediate disk image context. Via the new
  --offset= and --size-max= switches the downloaded data can be written
  to specific locations of a file (which is particularly useful to use
  the tool to download fs images and write them to a partition location
  before actually creating the partition).

We'll later use the latter feature for "sysupdate" concept, where images
can be directly be written to partitions. That way the systemd-import
binary will be used as backend for both "systemd-importd" and
"systemd-sysupdate" and share most of the same code.

4 years agoshared: add generic helper tools for installing files/dir trees
Lennart Poettering [Fri, 26 Feb 2021 16:41:30 +0000 (17:41 +0100)] 
shared: add generic helper tools for installing files/dir trees

This adds a bit of generic helper tools for installing files/dir trees.
"installing" is supposed to mean the final step when preparing a disk
image or directory tree, where the result is renamed to its final name.
It has some bells and whistles, as it is able to replace existing files
sanely, can fsync() things carefully and can mark things read-only in a
nice way.

This is supposed to be generic, unified code that can be used eventually
for any of our tools that prepare disk images/directory trees, including
importd, nspawn's --template= mechanism, the discover-image.c logic,
and more.

4 years agopo: Translated using Weblate (Portuguese (Brazil))
Gustavo Costa [Tue, 17 Aug 2021 07:04:48 +0000 (09:04 +0200)] 
po: Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: Gustavo Costa <xfgusta@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/pt_BR/
Translation: systemd/main

4 years agoMerge pull request #20450 from yuwata/ethtool-cleanups
Yu Watanabe [Mon, 16 Aug 2021 20:22:40 +0000 (05:22 +0900)] 
Merge pull request #20450 from yuwata/ethtool-cleanups

ethtool: trivial cleanups

4 years agoMerge pull request #20443 from yuwata/network-conf-parser-cleanups
Yu Watanabe [Mon, 16 Aug 2021 17:42:27 +0000 (02:42 +0900)] 
Merge pull request #20443 from yuwata/network-conf-parser-cleanups

network: conf parser cleanups

4 years agounit: coldplug both job and nop_job if possible
Geass-LL [Fri, 2 Apr 2021 03:27:59 +0000 (11:27 +0800)] 
unit: coldplug both job and nop_job if possible

Sometimes, both job and nop_job are deserialized. In this case,
if we only cold plug the job, the nop_job will also stuck in the
job list.

4 years agoMerge pull request #20442 from yuwata/network-can-introduce-many-settings
Yu Watanabe [Mon, 16 Aug 2021 17:40:32 +0000 (02:40 +0900)] 
Merge pull request #20442 from yuwata/network-can-introduce-many-settings

network: introduce several CAN interface related settings

4 years agonetwork: add address label on dhcpv4
Maxime de Roucy [Sat, 14 Aug 2021 20:50:14 +0000 (22:50 +0200)] 
network: add address label on dhcpv4

Fixes: #13967
4 years agonetwork: allow users to forbid passthru MACVLAN from putting its link into promiscuou...
Tom Yan [Mon, 16 Aug 2021 10:00:42 +0000 (18:00 +0800)] 
network: allow users to forbid passthru MACVLAN from putting its link into promiscuous mode

While we haven't implemented a key for users to set MACVLAN/MACVTAP flags,
we can at least allow them to make use of the Promiscuous= key of
the corresponding link to set the nopromisc flag.

4 years agoethtool: make ethtool_set_features() return earlier when nothing is requested 20450/head
Yu Watanabe [Mon, 16 Aug 2021 15:44:00 +0000 (00:44 +0900)] 
ethtool: make ethtool_set_features() return earlier when nothing is requested

4 years agoethtool: make the size of 'features' array static
Yu Watanabe [Mon, 16 Aug 2021 14:47:40 +0000 (23:47 +0900)] 
ethtool: make the size of 'features' array static

4 years agoman: address label can be set only for IPv4 addresses 20443/head
Yu Watanabe [Mon, 16 Aug 2021 03:57:18 +0000 (12:57 +0900)] 
man: address label can be set only for IPv4 addresses

4 years agosd-boot: Allow automatic entries to be default
Jan Janssen [Sat, 14 Aug 2021 11:06:37 +0000 (13:06 +0200)] 
sd-boot: Allow automatic entries to be default

4 years agosd-boot: Improve selection of initial entries to show
Jan Janssen [Sat, 14 Aug 2021 11:04:29 +0000 (13:04 +0200)] 
sd-boot: Improve selection of initial entries to show

4 years agoMerge pull request #20438 from medhefgo/boot
Lennart Poettering [Mon, 16 Aug 2021 13:35:08 +0000 (15:35 +0200)] 
Merge pull request #20438 from medhefgo/boot

sd-boot: Better self-detection and windows loader title