Commit Graph
64583 Commits
Author SHA1 Message Date
Mike Yuan 329f4b06f5 Merge pull request #27659 from yuwata/memfd-seal
memfd-util: handle F_SEAL_EXEC flag
2023-05-16 22:00:57 +08:00
Mike Yuan 0313c41068 Merge pull request #27638 from YHNdnzj/upheldby-unit-file
unit-file: support UpheldBy= in [Install] settings (adding Upholds= deps from .upholds/)
2023-05-16 21:53:24 +08:00
Lennart Poettering 3907b25638 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
2023-05-16 06:46:29 -07:00
Lennart Poettering 93d4a200fb Merge pull request #27648 from poettering/common-dissect-dir
pid1: add common root dir inode to mount disk images to in private namespaces
2023-05-16 05:26:48 -07:00
Lennart Poettering b10c4acfa3 Merge pull request #27647 from poettering/mount-setup-tweaklets
mount-setup: minor tweaks
2023-05-16 05:26:09 -07:00
Lennart Poettering 8a1b590591 Merge pull request #27658 from poettering/base-fs-run
base-filesystem: also set up /run/ mount point if missing
2023-05-16 05:25:43 -07:00
Lennart Poettering 7e0aaeb244 man: indicate that the JOB parameter to "systemctl cancel" is optional
As per:

https://social.treehouse.systems/@grawity/110376583742207755
2023-05-16 20:18:38 +08:00
Lennart Poettering acf493390a 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.
2023-05-16 12:08:41 +02:00
Lennart Poettering 7b674a9ee8 pid1: debug log client comm/description strings if available for incoming connections
Very useful for debugging, to see which clients actually connect.
2023-05-16 12:08:41 +02:00
Lennart Poettering b587194313 test: add testcase for the new sockaddr metainfo logic 2023-05-16 12:08:41 +02:00
Lennart Poettering c32f9648cc 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).
2023-05-16 12:08:41 +02:00
Yu Watanabe 3418ca21ed test: add basic test for memfd_set_sealed() and memfd_get_sealed() 2023-05-16 18:59:25 +09:00
Yu Watanabe 52e2672af2 memfd-util: set F_SEAL_EXEC flag if supported 2023-05-16 18:50:39 +09:00
Yu Watanabe 17915ea5b3 memfd-util: memfd may also have F_SEAL_EXEC flag
Follow-up for c29715a8f7.

Fixes #27608.
2023-05-16 18:48:32 +09:00
Yu Watanabe 8e3303333f missing: add more F_SEAL_XYZ flags 2023-05-16 18:46:16 +09:00
Lennart Poettering 84c61aea0f base-filesystem: mention why we don't carry an entry for /tmp/ for now 2023-05-16 11:45:21 +02:00
Lennart Poettering 4d88d83924 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.
2023-05-16 11:32:56 +02:00
Lennart Poettering a0cb335816 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.
2023-05-16 10:17:49 +02:00
Lennart Poettering f7794e423a test-bus-server: minor modernizations 2023-05-16 10:09:05 +02:00
Lennart Poettering 4b7604af31 test-bus-chat: modernize a few things 2023-05-16 10:09:05 +02:00
Lennart Poettering 04dc2db08a mount-setup: minor modernization 2023-05-16 10:01:28 +02:00
Lennart Poettering ce6fa09567 mount-setup: minor log improvement 2023-05-16 10:00:04 +02:00
Lennart Poettering 4900c3e5b1 mount-setup: port to logging about mount attempts via mount_*follow_verbose() 2023-05-16 10:00:04 +02:00
Lennart Poettering a4b3e94236 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.
2023-05-16 09:26:17 +02:00
Lennart Poettering be79c23569 pid1: port unit namespacing to new /run/systemd/mount-rootfs dir 2023-05-16 09:24:45 +02:00
Lennart Poettering 3690bfb5b2 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.
2023-05-16 09:24:45 +02:00
Lennart Poettering a789f72ed2 mount-util: add umount_and_free() helper 2023-05-16 09:24:45 +02:00
Zbigniew Jędrzejewski-Szmek f44744ff51 Merge pull request #27652 from keszybz/readme-more
Add man page for libsystemd, extend readme and stability promise
2023-05-16 08:51:19 +02:00
Zbigniew Jędrzejewski-Szmek 7ecce0e571 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.
2023-05-16 08:50:11 +02:00
Zbigniew Jędrzejewski-Szmek 522c108de1 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.
2023-05-16 08:50:11 +02:00
Yu Watanabe 5571048919 meson: fix description for link-udev-shared option 2023-05-16 14:14:06 +08:00
nikstur 916db27f16 man: use correct name for --bank option 2023-05-15 23:15:15 +01:00
saikat0511 738a195bd5 hwdb: fix keyboard entry for IdeapadFlex5 (#27643)
Fixes a bug caused by 19db450f3a (#27211).

Also this makes the model more specific.
2023-05-16 05:58:50 +09:00
Zbigniew Jędrzejewski-Szmek 4bc96dc162 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.
2023-05-15 22:53:22 +02:00
Zbigniew Jędrzejewski-Szmek 778816f4c8 meson: add sd_pid_notify_barrier link
Fixup for 0de3431871.
2023-05-15 22:51:49 +02:00
Lennart Poettering f81048f8f5 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.
2023-05-15 21:55:19 +08:00
Daan De Meyer 4340e5b6df Revert "units: Add missing dependencies on initrd-switch-root.target"
This reverts commit f0ad3e6b96.
2023-05-15 15:42:21 +02:00
Daan De Meyer 78c49d012c 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.
2023-05-15 15:41:53 +02:00
Daan De Meyer 1fb59099f6 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.
2023-05-15 15:41:53 +02:00
Robert Scheck c06d2e440c 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.
2023-05-15 13:30:04 +02:00
Daan De Meyer 3dca0b3661 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.
2023-05-15 11:45:58 +01:00
Luca Boccassi f9c91eea78 Merge pull request #27644 from mrc0mmand/fuzz-nspawn
test: update nspawn's basic config file used for fuzzing
2023-05-15 11:45:15 +01:00
Frantisek Sumsal 806b18240a 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.
2023-05-15 10:15:24 +02:00
Frantisek Sumsal 786f6d81f7 test: pass $BUILD_DIR as $COVERAGE_BUILD_DIR to the system manager
To make additional coverage-related tweaks slightly easier.
2023-05-15 10:06:54 +02:00
Mike Yuan b5b1351317 test: add tests for UpheldBy= in [Install] section 2023-05-15 15:04:38 +08:00
Mike Yuan 38f901791f unit-file: support UpheldBy= in [Install] settings (adding Upholds= deps
from .upholds/)

Closes #26896
2023-05-15 15:04:38 +08:00
Frantisek Sumsal 1c8bf49b67 test: update nspawn's basic config file used for fuzzing 2023-05-15 09:00:17 +02:00
Daan De Meyer 62281c78bb 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.
2023-05-15 10:16:27 +09:00
Luca Boccassi 048eb301ec Merge pull request #27640 from mrc0mmand/more-tests
test: more TEST-13-NSPAWN-SMOKE follow-ups
2023-05-14 23:35:05 +01:00
Frantisek Sumsal 08d547a481 test: rename TEST-13-NSPAWN-SMOKE to TEST-13-NSPAWN
To make it consistent with the rest of the tests.
2023-05-14 19:32:07 +02:00