]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
13 months agoswitch-root: add a comment regarding the safety limits of rm_rf_children()
Lennart Poettering [Mon, 15 May 2023 19:31:38 +0000 (21:31 +0200)] 
switch-root: add a comment regarding the safety limits of rm_rf_children()

13 months agoMerge pull request #27606 from YHNdnzj/loginctl-list-show-state
Yu Watanabe [Tue, 16 May 2023 16:41:13 +0000 (01:41 +0900)] 
Merge pull request #27606 from YHNdnzj/loginctl-list-show-state

loginctl: list-{users,sessions}: add a column for showing state

13 months agoMerge pull request #27655 from yuwata/udev-net-assign-alternative-names-only-on-add...
Yu Watanabe [Tue, 16 May 2023 16:39:40 +0000 (01:39 +0900)] 
Merge pull request #27655 from yuwata/udev-net-assign-alternative-names-only-on-add-event

udev/net: assign alternative names only on add event

13 months agoMerge pull request #27651 from mrc0mmand/more-nspawn-tests
Frantisek Sumsal [Tue, 16 May 2023 15:26:25 +0000 (17:26 +0200)] 
Merge pull request #27651 from mrc0mmand/more-nspawn-tests

nspawn: OCI related fixes & tests

13 months agoMerge pull request #27659 from yuwata/memfd-seal
Mike Yuan [Tue, 16 May 2023 14:00:57 +0000 (22:00 +0800)] 
Merge pull request #27659 from yuwata/memfd-seal

memfd-util: handle F_SEAL_EXEC flag

13 months agoMerge pull request #27638 from YHNdnzj/upheldby-unit-file
Mike Yuan [Tue, 16 May 2023 13:53:24 +0000 (21:53 +0800)] 
Merge pull request #27638 from YHNdnzj/upheldby-unit-file

unit-file: support UpheldBy= in [Install] settings (adding Upholds= deps from .upholds/)

13 months agoMerge pull request #27573 from poettering/sd-bus-description
Lennart Poettering [Tue, 16 May 2023 13:46:29 +0000 (06:46 -0700)] 
Merge pull request #27573 from poettering/sd-bus-description

sd-bus: pass bus description (and comm name) to per via socket address binding on AF_UNIX

13 months agoMerge pull request #27648 from poettering/common-dissect-dir
Lennart Poettering [Tue, 16 May 2023 12:26:48 +0000 (05:26 -0700)] 
Merge pull request #27648 from poettering/common-dissect-dir

pid1: add common root dir inode to mount disk images to in private namespaces

13 months agoMerge pull request #27647 from poettering/mount-setup-tweaklets
Lennart Poettering [Tue, 16 May 2023 12:26:09 +0000 (05:26 -0700)] 
Merge pull request #27647 from poettering/mount-setup-tweaklets

mount-setup: minor tweaks

13 months agoMerge pull request #27658 from poettering/base-fs-run
Lennart Poettering [Tue, 16 May 2023 12:25:43 +0000 (05:25 -0700)] 
Merge pull request #27658 from poettering/base-fs-run

base-filesystem: also set up /run/ mount point if missing

13 months agoman: indicate that the JOB parameter to "systemctl cancel" is optional
Lennart Poettering [Tue, 16 May 2023 07:35:39 +0000 (09:35 +0200)] 
man: indicate that the JOB parameter to "systemctl cancel" is optional

As per:

https://social.treehouse.systems/@grawity/110376583742207755

13 months agotest: add test for state in loginctl list-{users,sessions} 27606/head
Mike Yuan [Mon, 15 May 2023 05:45:33 +0000 (13:45 +0800)] 
test: add test for state in loginctl list-{users,sessions}

13 months agologinctl: list-sessions: also show state
Mike Yuan [Thu, 11 May 2023 05:21:37 +0000 (13:21 +0800)] 
loginctl: list-sessions: also show state

13 months agologinctl: list-sessions: minor modernization
Mike Yuan [Thu, 11 May 2023 05:17:59 +0000 (13:17 +0800)] 
loginctl: list-sessions: minor modernization

13 months agologinctl: list-users: also show state
Mike Yuan [Thu, 11 May 2023 05:05:39 +0000 (13:05 +0800)] 
loginctl: list-users: also show state

13 months agobusctl: set a description for the bus connection 27573/head
Lennart Poettering [Fri, 5 May 2023 19:33:56 +0000 (21:33 +0200)] 
busctl: set a description for the bus connection

Unlike most other bus connections in our codebase this one is created
manually and every setting set invididually. It hence does not have a
description by default (as all automatic connections have). Set one
explicitly.

13 months agopid1: debug log client comm/description strings if available for incoming connections
Lennart Poettering [Fri, 5 May 2023 19:45:54 +0000 (21:45 +0200)] 
pid1: debug log client comm/description strings if available for incoming connections

Very useful for debugging, to see which clients actually connect.

13 months agotest: add testcase for the new sockaddr metainfo logic
Lennart Poettering [Fri, 5 May 2023 19:47:02 +0000 (21:47 +0200)] 
test: add testcase for the new sockaddr metainfo logic

13 months agosd-bus: use the new information in the client's sockaddr in the creds structure
Lennart Poettering [Fri, 5 May 2023 19:43:57 +0000 (21:43 +0200)] 
sd-bus: use the new information in the client's sockaddr in the creds structure

Now that clients might convey comm/description strings via the sockaddr,
let's actually use them on the other side, read the data via
getpeername() parse it, and include it in the "owner" creds (which is
how we call the peer's creds).

13 months agotest: add basic test for memfd_set_sealed() and memfd_get_sealed() 27659/head
Yu Watanabe [Tue, 16 May 2023 09:59:25 +0000 (18:59 +0900)] 
test: add basic test for memfd_set_sealed() and memfd_get_sealed()

13 months agomemfd-util: set F_SEAL_EXEC flag if supported
Yu Watanabe [Tue, 16 May 2023 09:50:39 +0000 (18:50 +0900)] 
memfd-util: set F_SEAL_EXEC flag if supported

13 months agomemfd-util: memfd may also have F_SEAL_EXEC flag
Yu Watanabe [Tue, 16 May 2023 09:48:29 +0000 (18:48 +0900)] 
memfd-util: memfd may also have F_SEAL_EXEC flag

Follow-up for c29715a8f77d96cd731b4a3083b3a852b3b61eb8.

Fixes #27608.

13 months agomissing: add more F_SEAL_XYZ flags
Yu Watanabe [Tue, 16 May 2023 09:46:16 +0000 (18:46 +0900)] 
missing: add more F_SEAL_XYZ flags

13 months agobase-filesystem: mention why we don't carry an entry for /tmp/ for now 27658/head
Lennart Poettering [Tue, 16 May 2023 09:44:27 +0000 (11:44 +0200)] 
base-filesystem: mention why we don't carry an entry for /tmp/ for now

13 months agonspawn: make sure the device type survives when setting device mode 27651/head
Frantisek Sumsal [Tue, 16 May 2023 09:40:33 +0000 (11:40 +0200)] 
nspawn: make sure the device type survives when setting device mode

13 months agobase-filesystem: also set up /run/ mount point if missing
Lennart Poettering [Mon, 15 May 2023 19:20:36 +0000 (21:20 +0200)] 
base-filesystem: also set up /run/ mount point if missing

We don't support images without, hence create this one too, like we
create all other relevant mount points we definitely require for
booting.

13 months agotest: add tests for renaming network interface 27655/head
Yu Watanabe [Tue, 16 May 2023 07:28:54 +0000 (16:28 +0900)] 
test: add tests for renaming network interface

13 months agofuzz: update the base JSON for fuzz-nspawn-oci
Frantisek Sumsal [Mon, 15 May 2023 19:10:07 +0000 (21:10 +0200)] 
fuzz: update the base JSON for fuzz-nspawn-oci

13 months agotest: add a couple of tests for nspawn's OCI stuff
Frantisek Sumsal [Mon, 15 May 2023 16:57:55 +0000 (18:57 +0200)] 
test: add a couple of tests for nspawn's OCI stuff

13 months agonspawn: fix a global-buffer-overflow
Frantisek Sumsal [Mon, 15 May 2023 18:25:43 +0000 (20:25 +0200)] 
nspawn: fix a global-buffer-overflow

Whoopsie.

=================================================================
==3789231==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000051d0b8 at pc 0x7f70850bc904 bp 0x7ffd9bbdf660 sp 0x7ffd9bbdf658
READ of size 8 at 0x00000051d0b8 thread T0
    #0 0x7f70850bc903 in json_dispatch ../src/shared/json.c:4347
    #1 0x4a5b54 in oci_seccomp_syscalls ../src/nspawn/nspawn-oci.c:1838
    #2 0x7f70850bd359 in json_dispatch ../src/shared/json.c:4395
    #3 0x4a668c in oci_seccomp ../src/nspawn/nspawn-oci.c:1905
    #4 0x7f70850bd359 in json_dispatch ../src/shared/json.c:4395
    #5 0x4a7d8c in oci_linux ../src/nspawn/nspawn-oci.c:2030
    #6 0x7f70850bd359 in json_dispatch ../src/shared/json.c:4395
    #7 0x4aa31c in oci_load ../src/nspawn/nspawn-oci.c:2198
    #8 0x446cec in load_oci_bundle ../src/nspawn/nspawn.c:4744
    #9 0x44ffa7 in run ../src/nspawn/nspawn.c:5477
    #10 0x4552fb in main ../src/nspawn/nspawn.c:5920
    #11 0x7f7083a4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
    #12 0x7f7083a4a5c8 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x275c8)
    #13 0x40d284 in _start (/home/fsumsal/repos/@systemd/systemd/build-san/systemd-nspawn+0x40d284)

0x00000051d0b8 is located 40 bytes to the left of global variable 'bus_standard_errors_copy_0' defined in '../src/libsystemd/sd-bus/bus-error.h:57:1' (0x51d0e0) of size 8
0x00000051d0b8 is located 0 bytes to the right of global variable 'table' defined in '../src/nspawn/nspawn-oci.c:1829:43' (0x51d040) of size 120
SUMMARY: AddressSanitizer: global-buffer-overflow ../src/shared/json.c:4347 in json_dispatch
Shadow bytes around the buggy address:
  0x00008009b9c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008009b9d0: 00 00 00 00 f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x00008009b9e0: 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x00008009b9f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008009ba00: 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
=>0x00008009ba10: 00 00 00 00 00 00 00[f9]f9 f9 f9 f9 00 f9 f9 f9
  0x00008009ba20: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008009ba30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008009ba40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008009ba50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008009ba60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==3789231==ABORTING

13 months agonspawn: fix inverted condition
Frantisek Sumsal [Mon, 15 May 2023 18:10:05 +0000 (20:10 +0200)] 
nspawn: fix inverted condition

13 months agonspawn: call json_dispatch() with a correct pointer
Frantisek Sumsal [Mon, 15 May 2023 17:45:13 +0000 (19:45 +0200)] 
nspawn: call json_dispatch() with a correct pointer

Otherwise hilarity ensues:

 AddressSanitizer:DEADLYSIGNAL
 =================================================================
 ==722==ERROR: AddressSanitizer: SEGV on unknown address 0xffffffff00000000 (pc 0x7f8d50ca9ffb bp 0x7fff11b0d4a0 sp 0x7fff11b0cc30 T0)
 ==722==The signal is caused by a READ memory access.
     #0 0x7f8d50ca9ffb in __interceptor_strcmp.part.0 (/lib64/libasan.so.8+0xa9ffb)
     #1 0x7f8d4f9cf5a1 in strcmp_ptr ../src/fundamental/string-util-fundamental.h:33
     #2 0x7f8d4f9cf5f8 in streq_ptr ../src/fundamental/string-util-fundamental.h:46
     #3 0x7f8d4f9d74d2 in free_and_strdup ../src/basic/string-util.c:948
     #4 0x49139a in free_and_strdup_warn ../src/basic/string-util.h:197
     #5 0x4923eb in oci_absolute_path ../src/nspawn/nspawn-oci.c:139
     #6 0x7f8d4f6bd359 in json_dispatch ../src/shared/json.c:4395
     #7 0x4a8831 in oci_hooks_array ../src/nspawn/nspawn-oci.c:2089
     #8 0x7f8d4f6bd359 in json_dispatch ../src/shared/json.c:4395
     #9 0x4a8b56 in oci_hooks ../src/nspawn/nspawn-oci.c:2112
     #10 0x7f8d4f6bd359 in json_dispatch ../src/shared/json.c:4395
     #11 0x4aa298 in oci_load ../src/nspawn/nspawn-oci.c:2197
     #12 0x446cec in load_oci_bundle ../src/nspawn/nspawn.c:4744
     #13 0x44ffa7 in run ../src/nspawn/nspawn.c:5477
     #14 0x4552fb in main ../src/nspawn/nspawn.c:5920
     #15 0x7f8d4e04a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
     #16 0x7f8d4e04a5c8 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x275c8)
     #17 0x40d284 in _start (/usr/bin/systemd-nspawn+0x40d284)
 AddressSanitizer can not provide additional info.
 SUMMARY: AddressSanitizer: SEGV (/lib64/libasan.so.8+0xa9ffb) in __interceptor_strcmp.part.0
 ==722==ABORTING

13 months agonspawn: all hooks should be arrays of objects, not just objects
Frantisek Sumsal [Mon, 15 May 2023 17:44:15 +0000 (19:44 +0200)] 
nspawn: all hooks should be arrays of objects, not just objects

See: https://github.com/opencontainers/runtime-spec/blob/v1.0.0/config.md#posix-platform-hooks

13 months agonspawn: use the just returned errno in the log message
Frantisek Sumsal [Mon, 15 May 2023 17:06:14 +0000 (19:06 +0200)] 
nspawn: use the just returned errno in the log message

Use the returned errno even though we are going to ignore it, otherwise
the log message is just confusing:

config.json:119:13: Failed to resolve device node 4:2, ignoring: Success

13 months agonspawn: disableOOMKiller should be boolean, not int
Frantisek Sumsal [Mon, 15 May 2023 16:42:08 +0000 (18:42 +0200)] 
nspawn: disableOOMKiller should be boolean, not int

See: https://github.com/opencontainers/runtime-spec/blob/v1.0.0/config-linux.md#memory

13 months agonspawn: modernize the cleanup functions a bit
Frantisek Sumsal [Tue, 16 May 2023 06:19:09 +0000 (08:19 +0200)] 
nspawn: modernize the cleanup functions a bit

13 months agonspawn: avoid NULL pointer dereference
Frantisek Sumsal [Tue, 16 May 2023 06:18:32 +0000 (08:18 +0200)] 
nspawn: avoid NULL pointer dereference

When merging the settings we take the pointer to the array of extra
devices, but don't reset the array counter to zero. This later leads to
a NULL pointer dereference, where device_node_array_free() attempts to
loop over a NULL pointer:

+ systemd-nspawn --oci-bundle=/var/lib/machines/testsuite-13.oci-bundle.Npo
 ../src/nspawn/nspawn-settings.c:118:29: runtime error: member access within null pointer of type 'struct DeviceNode'
     #0 0x4b91ee in device_node_array_free ../src/nspawn/nspawn-settings.c:118
     #1 0x4ba42a in settings_free ../src/nspawn/nspawn-settings.c:161
     #2 0x410b79 in settings_freep ../src/nspawn/nspawn-settings.h:249
     #3 0x446ce8 in load_oci_bundle ../src/nspawn/nspawn.c:4733
     #4 0x44ff42 in run ../src/nspawn/nspawn.c:5476
     #5 0x455296 in main ../src/nspawn/nspawn.c:5919
     #6 0x7f0cb7a4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
     #7 0x7f0cb7a4a5c8 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x275c8)
     #8 0x40d284 in _start (/usr/bin/systemd-nspawn+0x40d284)
 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/nspawn/nspawn-settings.c:118:29 in

Also, add an appropriate assert to catch such issues in the future.

13 months agosd-bus: bind outgoing AF_UNIX sockets to abstract addresses conveying client comm...
Lennart Poettering [Fri, 5 May 2023 19:35:19 +0000 (21:35 +0200)] 
sd-bus: bind outgoing AF_UNIX sockets to abstract addresses conveying client comm + bus description string

Let's pass some additional meta information along bus connections
without actually altering the communication protocol.

Pass the client comm and client description string of the bus via
including it in the abstract namespace client socket address we connect
to. This is purely informational (and entirely user controlled), but has
the benefit that servers can make use of the information if they want,
but really don't have to. It works entirely transparently.

This takes inspiration from how we convey similar information via
credential socket connections.

13 months agotest-bus-server: minor modernizations
Lennart Poettering [Fri, 5 May 2023 19:47:43 +0000 (21:47 +0200)] 
test-bus-server: minor modernizations

13 months agotest-bus-chat: modernize a few things
Lennart Poettering [Fri, 5 May 2023 18:01:05 +0000 (20:01 +0200)] 
test-bus-chat: modernize a few things

13 months agomount-setup: minor modernization 27647/head
Lennart Poettering [Mon, 15 May 2023 09:53:07 +0000 (11:53 +0200)] 
mount-setup: minor modernization

13 months agomount-setup: minor log improvement
Lennart Poettering [Mon, 15 May 2023 09:52:47 +0000 (11:52 +0200)] 
mount-setup: minor log improvement

13 months agomount-setup: port to logging about mount attempts via mount_*follow_verbose()
Lennart Poettering [Mon, 15 May 2023 09:52:33 +0000 (11:52 +0200)] 
mount-setup: port to logging about mount attempts via mount_*follow_verbose()

13 months agoudev/net: assign alternative names only on add uevent
Yu Watanabe [Tue, 16 May 2023 03:28:23 +0000 (12:28 +0900)] 
udev/net: assign alternative names only on add uevent

Previously, we first assign alternative names to a network interface,
then later change its main name if requested. So, we could not assign
the name that currently assigned as the main name of an interface as an
alternative name. So, we retry to assign the previous main name as an
alternative name on later move uevent.

However, that causes some confusing situation. E.g. if a .link file has
```
Name=foo
AlternativeNames=foo baz
```
then even if the interface is renamed by a user e.g. by invoking 'ip link'
command manually, the interface can be still referenced as 'foo', as the
name is now assigned as an alternative name.

This makes the order of name assignment inverse: the main name is first
changed, and then the requested alternative names are assigned. And
udevd do not assign alternative names on move uevent.

Replaces #27506.

13 months agosd-netlink: make rtnl_set_link_name() optionally append alternative names
Yu Watanabe [Tue, 16 May 2023 04:29:37 +0000 (13:29 +0900)] 
sd-netlink: make rtnl_set_link_name() optionally append alternative names

13 months agoudev/net: generate new network interface name only on add uevent
Yu Watanabe [Tue, 16 May 2023 04:05:09 +0000 (13:05 +0900)] 
udev/net: generate new network interface name only on add uevent

On other uevents, the name will be anyway ignored in rename_netif() in
udev-event.c.

13 months agoudev/net: verify ID_NET_XYZ before trying to assign it as an alternative name
Yu Watanabe [Tue, 16 May 2023 02:46:11 +0000 (11:46 +0900)] 
udev/net: verify ID_NET_XYZ before trying to assign it as an alternative name

13 months agoudev: make udev_builtin_run() take UdevEvent*
Yu Watanabe [Tue, 16 May 2023 02:29:49 +0000 (11:29 +0900)] 
udev: make udev_builtin_run() take UdevEvent*

No functional change, preparation for later commits.

13 months agoudev: use SYNTHETIC_ERRNO() at one more place
Yu Watanabe [Tue, 16 May 2023 07:34:31 +0000 (16:34 +0900)] 
udev: use SYNTHETIC_ERRNO() at one more place

13 months agodissect-image: port mount_image_privately_interactively() to use /run/systemd/mount... 27648/head
Lennart Poettering [Mon, 15 May 2023 09:49:48 +0000 (11:49 +0200)] 
dissect-image: port mount_image_privately_interactively() to use /run/systemd/mount-rootfs/ too

Let's use the same common directory as the unit logic uses.

This means we have less to clean up, and opens the door to eventually
allow unprivileged operation of the
mount_image_privately_interactively() logic.

13 months agopid1: port unit namespacing to new /run/systemd/mount-rootfs dir
Lennart Poettering [Mon, 15 May 2023 10:32:54 +0000 (12:32 +0200)] 
pid1: port unit namespacing to new /run/systemd/mount-rootfs dir

13 months agonamespace: introduce a common dir in /run/ that we can use to see new root fs up on
Lennart Poettering [Mon, 15 May 2023 09:35:15 +0000 (11:35 +0200)] 
namespace: introduce a common dir in /run/ that we can use to see new root fs up on

This creates a new dir /run/systemd/mount-rootfs/ early in PID 1 that
thus always exists. It's supposed to be used by any code that creates
its own mount namespace and then sets up a new root dir to switch into.
So far in many cases we used a temporary dir (which needed explicit
clean-up) or a purpose-specific fixed dir.

Let's create a common dir instead, that always exists (as it is created
in PID 1 early on, always).

Besides making things more robust, as manual clean-up of the inode is
not necessary anymore this also opens the door for unprivileged programs
to use the same dir, since it now always exists.

Set the access mode to 555 (instead of the otherwise previously used
0755, 0700 or similar), so that unprivileged programs can access it, but
we make clear it's not supposed to be written directly to, by anyone,
not even root.

13 months agomount-util: add umount_and_free() helper
Lennart Poettering [Thu, 20 Apr 2023 16:45:09 +0000 (18:45 +0200)] 
mount-util: add umount_and_free() helper

13 months agoMerge pull request #27652 from keszybz/readme-more
Zbigniew Jędrzejewski-Szmek [Tue, 16 May 2023 06:51:19 +0000 (08:51 +0200)] 
Merge pull request #27652 from keszybz/readme-more

Add man page for libsystemd, extend readme and stability promise

13 months agodocs: list all public headers in stability promise 27652/head
Zbigniew Jędrzejewski-Szmek [Mon, 15 May 2023 20:48:50 +0000 (22:48 +0200)] 
docs: list all public headers in stability promise

We provide the same stability for all the headers that are public.

Also, mark id128 as portable to other systems. There is really nothing in the
code that would make it hard. It would probably work out-of-the-box.

13 months agoREADME: describe how our libraries are linked
Zbigniew Jędrzejewski-Szmek [Mon, 15 May 2023 20:35:10 +0000 (22:35 +0200)] 
README: describe how our libraries are linked

In https://github.com/systemd/systemd/pull/27637#issuecomment-1547517316
we discussed disclaiming warranty when distros do version mixing.
But to make this disclaimer meaningful, we need to document what options are
available.

13 months agomeson: fix description for link-udev-shared option
Yu Watanabe [Mon, 15 May 2023 23:30:44 +0000 (08:30 +0900)] 
meson: fix description for link-udev-shared option

13 months agoman: use correct name for --bank option
nikstur [Mon, 15 May 2023 21:34:27 +0000 (23:34 +0200)] 
man: use correct name for --bank option

13 months agohwdb: fix keyboard entry for IdeapadFlex5 (#27643)
saikat0511 [Mon, 15 May 2023 20:58:50 +0000 (02:28 +0530)] 
hwdb: fix keyboard entry for IdeapadFlex5 (#27643)

Fixes a bug caused by 19db450f3a243fcaf0949beebafc3025f8e3a98e (#27211).

Also this makes the model more specific.

13 months agoman: add libsystemd(3)
Zbigniew Jędrzejewski-Szmek [Mon, 15 May 2023 13:17:13 +0000 (15:17 +0200)] 
man: add libsystemd(3)

Before libsystemd-daemon, libsystemd-journal, libsystemd-id128, etc., were
merged into libsystemd, it was enough to have individual man pages for them.
But they have been delivered as one thing for many years, so it's better to
have a landing page for libsystemd. It mostly directs to individual pages
anyway.

13 months agomeson: add sd_pid_notify_barrier link
Zbigniew Jędrzejewski-Szmek [Mon, 15 May 2023 20:37:20 +0000 (22:37 +0200)] 
meson: add sd_pid_notify_barrier link

Fixup for 0de343187127f6a5a93602608812e60fc4092c9a.

13 months agowatchdog: always disarm watchdog properly before closing it
Lennart Poettering [Sat, 13 May 2023 14:44:50 +0000 (07:44 -0700)] 
watchdog: always disarm watchdog properly before closing it

If we change the watchdog device we should disarm the old one first.

Similar, if we open the watchdog, but then fail setting it up, disarm it
before closing it again.

13 months agoRevert "units: Add missing dependencies on initrd-switch-root.target"
Daan De Meyer [Mon, 15 May 2023 11:52:41 +0000 (13:52 +0200)] 
Revert "units: Add missing dependencies on initrd-switch-root.target"

This reverts commit f0ad3e6b9652fe785245934ff8604cc897d3b8f4.

13 months agomkosi: Always pull in network-online.target
Daan De Meyer [Mon, 15 May 2023 12:09:08 +0000 (14:09 +0200)] 
mkosi: Always pull in network-online.target

Let's always pull this in so that we always activate
systemd-networkd-wait-online for extra coverage.

13 months agomkosi: Drop squashfs dropin
Daan De Meyer [Mon, 15 May 2023 12:08:22 +0000 (14:08 +0200)] 
mkosi: Drop squashfs dropin

This accidentally got pulled into a commit even though it was only
for local testing, let's drop it again so we correctly use erofs
when building local images.

13 months agonspawn: file system namespace -> mount namespace
Frantisek Sumsal [Mon, 15 May 2023 12:05:15 +0000 (14:05 +0200)] 
nspawn: file system namespace -> mount namespace

13 months agonspawn: fix a typo in an error message
Frantisek Sumsal [Mon, 15 May 2023 12:01:58 +0000 (14:01 +0200)] 
nspawn: fix a typo in an error message

13 months agoportable, meson: allow statically linked build
Robert Scheck [Sun, 14 May 2023 01:17:47 +0000 (03:17 +0200)] 
portable, meson: allow statically linked build

Build option "link-portabled-shared" to build a statically linked
systemd-portabled by using

  -Dlink-portabled-shared=false

on systems with full systemd stack except systemd-portabled, such
as CentOS/RHEL 9.

13 months agomkosi: Install tmux in the final image
Daan De Meyer [Mon, 15 May 2023 09:54:14 +0000 (11:54 +0200)] 
mkosi: Install tmux in the final image

We currently have to resort to SSH to get more than one interactive
terminal in a mkosi qemu VM. Let's increase our options by installing
tmux in the final image, which can multiplex the serial console into
many unique terminal sessions.

13 months agoMerge pull request #27644 from mrc0mmand/fuzz-nspawn
Luca Boccassi [Mon, 15 May 2023 10:45:15 +0000 (11:45 +0100)] 
Merge pull request #27644 from mrc0mmand/fuzz-nspawn

test: update nspawn's basic config file used for fuzzing

13 months agotest: make $BUILD_DIR writable when rootfs is mounted read-only 27644/head
Frantisek Sumsal [Mon, 15 May 2023 08:15:24 +0000 (10:15 +0200)] 
test: make $BUILD_DIR writable when rootfs is mounted read-only

Adjust two systemd-nspawn invocations where rootfs is mounted read-only,
to avoid gcov complaining.

13 months agotest: pass $BUILD_DIR as $COVERAGE_BUILD_DIR to the system manager
Frantisek Sumsal [Mon, 15 May 2023 08:06:18 +0000 (10:06 +0200)] 
test: pass $BUILD_DIR as $COVERAGE_BUILD_DIR to the system manager

To make additional coverage-related tweaks slightly easier.

13 months agotest: add tests for UpheldBy= in [Install] section 27638/head
Mike Yuan [Mon, 15 May 2023 06:41:29 +0000 (14:41 +0800)] 
test: add tests for UpheldBy= in [Install] section

13 months agounit-file: support UpheldBy= in [Install] settings (adding Upholds= deps
Mike Yuan [Sun, 14 May 2023 09:48:25 +0000 (17:48 +0800)] 
unit-file: support UpheldBy= in [Install] settings (adding Upholds= deps
from .upholds/)

Closes #26896

13 months agotest: update nspawn's basic config file used for fuzzing
Frantisek Sumsal [Mon, 15 May 2023 07:00:17 +0000 (09:00 +0200)] 
test: update nspawn's basic config file used for fuzzing

13 months agomachine-id-setup: Do not overwrite if /etc/machine-id contains uninitialized
Daan De Meyer [Wed, 10 May 2023 13:16:09 +0000 (15:16 +0200)] 
machine-id-setup: Do not overwrite if /etc/machine-id contains uninitialized

When we're building OS images, we never want /etc/machine-id to contain
anything other than "uninitialized" until we actually boot the image. So
let's allow image builders to write "uninitialized" to /etc/machine-id
and if systemd-machine-id-setup is called after, make sure we don't
overwrite it.

13 months agoMerge pull request #27640 from mrc0mmand/more-tests
Luca Boccassi [Sun, 14 May 2023 22:35:05 +0000 (23:35 +0100)] 
Merge pull request #27640 from mrc0mmand/more-tests

test: more TEST-13-NSPAWN-SMOKE follow-ups

13 months agotest: rename TEST-13-NSPAWN-SMOKE to TEST-13-NSPAWN 27640/head
Frantisek Sumsal [Sun, 14 May 2023 16:42:11 +0000 (18:42 +0200)] 
test: rename TEST-13-NSPAWN-SMOKE to TEST-13-NSPAWN

To make it consistent with the rest of the tests.

13 months agotest: slightly extend the systemd-nspawn tests
Frantisek Sumsal [Sun, 14 May 2023 16:24:33 +0000 (18:24 +0200)] 
test: slightly extend the systemd-nspawn tests

13 months agotest: wait after sending a signal if necessary
Frantisek Sumsal [Sun, 14 May 2023 12:20:51 +0000 (14:20 +0200)] 
test: wait after sending a signal if necessary

On overloaded systems it might take a bit until the signal is sent,
processed, and the respective file is created.

13 months agonspawn: simplify error handling
Frantisek Sumsal [Sun, 14 May 2023 12:16:44 +0000 (14:16 +0200)] 
nspawn: simplify error handling

13 months agotest: install the overlayfs/loop modules unconditionally
Frantisek Sumsal [Sun, 14 May 2023 11:13:24 +0000 (13:13 +0200)] 
test: install the overlayfs/loop modules unconditionally

13 months agotest: create merged-usr containers
Frantisek Sumsal [Sun, 14 May 2023 10:39:08 +0000 (12:39 +0200)] 
test: create merged-usr containers

13 months agotest: bind mount the $BUILD_DIR into nspawn containers
Frantisek Sumsal [Sun, 14 May 2023 09:28:30 +0000 (11:28 +0200)] 
test: bind mount the $BUILD_DIR into nspawn containers

when collecting coverage. This applies only to containers started
via machinectl (or directly via the systemd-nspawn@.service unit).

13 months agotest: use dropins to override system configuration
Frantisek Sumsal [Sun, 14 May 2023 06:15:33 +0000 (08:15 +0200)] 
test: use dropins to override system configuration

Instead of touching the configuration files directly.

13 months agovimrc: use 109ch text width for shell scripts as well
Frantisek Sumsal [Sat, 13 May 2023 19:59:34 +0000 (21:59 +0200)] 
vimrc: use 109ch text width for shell scripts as well

13 months agopo: Translated using Weblate (Belarusian)
Maksim Kliazovich [Sat, 13 May 2023 19:20:55 +0000 (21:20 +0200)] 
po: Translated using Weblate (Belarusian)

Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: Maksim Kliazovich <maxklezovich@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/be/
Translation: systemd/main

13 months agosd-dhcp-server: also send DNS servers or friends on DHCPOFFER
Yu Watanabe [Thu, 11 May 2023 07:42:27 +0000 (16:42 +0900)] 
sd-dhcp-server: also send DNS servers or friends on DHCPOFFER

From RFC 2131 section 4.3.1 (https://www.rfc-editor.org/rfc/rfc2131#section-4.3.1):
----
The server MUST return to the client:
- Parameters requested by the client, according to the following rules:
  -- IF the server has been explicitly configured with a default
     value for the parameter, the server MUST include that value
     in an appropriate option in the 'option' field,
----
The sentence is not only for ACK, but for all (positive) responses, that
is DHCPOFFER and DHCPACK.

Fixes #27471.

13 months agoMerge pull request #27605 from YHNdnzj/dbus-activation-followup
Luca Boccassi [Sat, 13 May 2023 10:49:21 +0000 (11:49 +0100)] 
Merge pull request #27605 from YHNdnzj/dbus-activation-followup

core: only refuse Type=dbus service enqueue if dbus has pending stop job

13 months agoMerge pull request #27571 from DaanDeMeyer/mkosi
Luca Boccassi [Sat, 13 May 2023 10:09:00 +0000 (11:09 +0100)] 
Merge pull request #27571 from DaanDeMeyer/mkosi

mkosi: Package a erofs usr partition with signed verity

13 months agoMerge pull request #27634 from mrc0mmand/TEST-13-shenanigans
Luca Boccassi [Sat, 13 May 2023 09:23:14 +0000 (10:23 +0100)] 
Merge pull request #27634 from mrc0mmand/TEST-13-shenanigans

test: clean up & extend the nspawn/machinectl test suite

13 months agomkosi: Package a erofs usr partition with signed verity 27571/head
Daan De Meyer [Mon, 8 May 2023 14:06:41 +0000 (16:06 +0200)] 
mkosi: Package a erofs usr partition with signed verity

Let's start moving towards a more involved partitioning setup to
test our stuff more when using mkosi.

The root partition is generated on boot with systemd-repart.

CentOS supports neither erofs nor btrfs so we use squashfs and xfs
instead.

We also enable SecureBoot= locally for additional coverage. This
and the use of verity means users need to run `mkosi genkey` once
to generate the keys necessary to do secure boot and verity.

13 months agomkosi: Store /etc under /usr/share/factory/mkosi
Daan De Meyer [Tue, 9 May 2023 11:47:43 +0000 (13:47 +0200)] 
mkosi: Store /etc under /usr/share/factory/mkosi

If we're making a /usr only image, we still want to populate /etc
fully on first boot. To make that possible, let's copy /etc to
/usr/share/factory/mkosi in a finalize script, which runs after
all changes to the image have been made. Let's also add a tmpfiles
snippet that merges /usr/share/factory/mkosi with /etc on boot to
populate /etc.

13 months agomkosi: Do not enable ACL usage by default
Daan De Meyer [Fri, 12 May 2023 15:24:39 +0000 (17:24 +0200)] 
mkosi: Do not enable ACL usage by default

This is only useful to be able to remove generated files using rm -rf
instead of mkosi clean and has some implications for the generated
rootfs so let's not enable it by default.

13 months agosulogin: Read SYSTEMD_SULOGIN_FORCE from kernel cmdline
Daan De Meyer [Mon, 8 May 2023 09:03:32 +0000 (11:03 +0200)] 
sulogin: Read SYSTEMD_SULOGIN_FORCE from kernel cmdline

This allows setting it on the kernel cmdline and having it work
automatically without having to write any dropins or such.

Also enable the option in mkosi so that we can debug the initrd
properly with a locked root account.

13 months agomachine,portable: fix a typo in an info message 27634/head
Frantisek Sumsal [Fri, 12 May 2023 19:36:50 +0000 (21:36 +0200)] 
machine,portable: fix a typo in an info message

13 months agotest: merge machinectl edit/cat tests into TEST-13
Frantisek Sumsal [Fri, 12 May 2023 15:59:54 +0000 (17:59 +0200)] 
test: merge machinectl edit/cat tests into TEST-13

13 months agotest: always install the script utility
Frantisek Sumsal [Fri, 12 May 2023 15:56:22 +0000 (17:56 +0200)] 
test: always install the script utility

13 months agotest: add a couple of tests for machinectl
Frantisek Sumsal [Fri, 12 May 2023 15:39:41 +0000 (17:39 +0200)] 
test: add a couple of tests for machinectl

13 months agoMerge pull request #27633 from DaanDeMeyer/repart-dropin
Luca Boccassi [Fri, 12 May 2023 20:29:38 +0000 (21:29 +0100)] 
Merge pull request #27633 from DaanDeMeyer/repart-dropin

repart: Make sure we look up dropin files in the root directory