Commit Graph

79533 Commits

Author SHA1 Message Date
Philip Withnall
5fe4edd3fc docs: Fix some confusing wording in various D-Bus docs
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-02-20 18:13:21 +00:00
Lennart Poettering
25ec3fdfd3 core: also check boot ID and product UUID in ConditionHost=
Sometimes it's interesting to condition units not just on the
installation but on the physical device. Let's make ConditionHost=
useful for that kind of checks, and while we are at it, also allow it to
be used for condition checks on the boot id.

Overloading like this is safe, since UUIDs are globally unique after
all, and hence there should be no conflicts between the namespace of
boot ids, machine ids and product ids.

Finally, relax rules on uuid checking: if the specified string parses
as uuid or id, also check it against the hostname, for setups where
people name hosts after uuids. I wouldn't know why anyone would do that,
but also, why not? shouldn'rt hurt allowing them and should not create
ambiguity conflicts.
2025-02-20 18:13:38 +01:00
Lennart Poettering
9ef8138946 homework: unify common error handling 2025-02-20 18:13:18 +01:00
Lennart Poettering
cfeeaebafe homed: explicitly set access mode of private/public signing key pair
So far we relied that the temporary file logic would create the key
files with 0600 mode, but let's set the access mode explicitly:

1. Tighten private key file access from 0600 to 0400, after all we never
   want to write it again, it's not a mutable file.

2. Relaxed public key file access mode from 0600 to 0444, after all it's
   a public key file, and people should be able to see it if they want
   This is useful for propagating the key onto other systems if needed.
2025-02-20 17:35:12 +01:00
Lennart Poettering
9df18e4bee tree-wide: initialize row/column explicitly before calling sd_json_parse_file()
The variables are error return parameters, i.e. only initialized on some errors,
not all. Let's hence always zero initialize them.
2025-02-20 17:34:36 +01:00
Lennart Poettering
2cf95e5178 homed: return the correct error if an image file is not present when we try to activate it
We already return BUS_ERROR_HOME_ABSENT when we detect the image being
absent before we fork off the homework worker. Let's also return the
same error if the homework process notices the same condition while
actually doing something.

This mostly fixes a race, that the same condition seen at different
points in time results in the same errors.
2025-02-20 17:34:02 +01:00
Lennart Poettering
6828cc112a resolve: cleanups for validating query flags and fix resolving service with record type filter (#36398)
Follow-up for 81ae2237c1.
Fixes
https://github.com/systemd/systemd/pull/36353#issuecomment-2659558382.
2025-02-20 17:31:19 +01:00
Daan De Meyer
4d65c9f70c mkosi: Enable userdb tmpfiles dropin on Fedora/CentOS
It's disabled by default in the Fedora spec, but still available
as an example file. Let's symlink it to the proper name in the images
to enable it again.
2025-02-20 16:57:22 +01:00
Lennart Poettering
b3adb7cd63 user-runtime-dir: use right accessor got get GID of account 2025-02-20 16:44:41 +01:00
Lennart Poettering
06d77db6fb homed: make "register" call more friendly
Let's accept full user records (including status and so on) and simply
eat up the parts we don't care about, instead of refusing the whole
record wholesale.

This makes it easier to just copy a user record from one machine and
registering it at another, without stripping the irrelevant parts first.
2025-02-20 16:44:10 +01:00
Lennart Poettering
a971e6603f update TODO 2025-02-20 15:24:19 +01:00
Pavithra Barithaya
6a12c90ca3 timedated: Send error when time set is past build date time
When the user/customer sets the time on the system which is prior
than that of the systemd build time, as systemd doesn't allow time
before it's build date after a reboot, systemd is resetting it but
there is no error or exception present in the setTime method due
to which user/customer is unaware of why the time is reset back to
the systemd-build time.

Added a condition check in the set_time() method to return an
error when tried to set time past the systemd build date.

Tested: Verified that it throws an error when we try to set the
time prior to systemd build date.

Change-Id: Ia6b58320bdb7234a21885a44af8fd3bda64c3789
2025-02-20 15:22:15 +01:00
Daan De Meyer
4ce6b7d2b6 mkosi: Install systemd-boot in opensuse initrd
This contains the systemd-stub tmpfiles snippet which we need to
copy stuff from /.extra to /run/systemd/stub which
TEST-86-MULTI-UKI-PROFILE depends on to work properly.
2025-02-20 15:18:14 +01:00
Daan De Meyer
a102b28ad4 mkosi: Do not run unit tests during build by default (#36450) 2025-02-20 13:25:03 +01:00
Ahmad Fatoum
6f8a9d0917 man: fix typo in systemd.watchdog_device kernel option
The option that systemd actually looks for has an underscore and no dash
as can be seen in src/core/main.c.

The man/kernel-command-line.xml documentation also gets it right with
this file being the only instance of watchdog-device being used.

Fixes: c75396c30b ("documentation: add description for watchdog device path")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
2025-02-20 12:18:45 +00:00
Luca Boccassi
c6a932fd0d tools/dbus_exporter: set LD_ORIGIN_PATH if procfs is not available
The script runs the binaries which try to find the internal libs via /proc/self/exe due
to glibc's RPATH resolution and fail:

/var/cache/src/systemd/tools/dbus_exporter.py interfaces
 /var/cache/src/systemd/build/systemd
 /var/cache/src/systemd/build/systemd-homed
 /var/cache/src/systemd/build/systemd-hostnamed
 /var/cache/src/systemd/build/systemd-importd
 /var/cache/src/systemd/build/systemd-localed
 /var/cache/src/systemd/build/systemd-logind
 /var/cache/src/systemd/build/systemd-machined
 /var/cache/src/systemd/build/systemd-networkd
 /var/cache/src/systemd/build/systemd-oomd
 /var/cache/src/systemd/build/systemd-portabled
 /var/cache/src/systemd/build/systemd-resolved
 /var/cache/src/systemd/build/systemd-sysupdated
 /var/cache/src/systemd/build/systemd-timedated
execve("/var/cache/src/systemd/build/systemd", ["/var/cache/src/systemd/build/sys"..., "--bus-introspect", "list"], 0x7ffc7ab68600 /* 20 vars */) = 0
brk(NULL)                               = 0x56265bf70000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f56ced7f000
readlinkat(AT_FDCWD, "/proc/self/exe", 0x7ffedeaa7a90, 4096) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=20293, ...}) = 0
mmap(NULL, 20293, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f56ced7a000
close(3)                                = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v4/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v4/", 0x7ffedeaa80b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v3/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v3/", 0x7ffedeaa80b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2/", 0x7ffedeaa80b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib/x86_64-linux-gnu/", {st_mode=S_IFDIR|0755, st_size=19312, ...}, 0) = 0
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v4/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v4/", 0x7ffedeaa80b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v3/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v3/", 0x7ffedeaa80b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2/", 0x7ffedeaa80b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/", {st_mode=S_IFDIR|0755, st_size=19312, ...}, 0) = 0
openat(AT_FDCWD, "/lib/glibc-hwcaps/x86-64-v4/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib/glibc-hwcaps/x86-64-v4/", 0x7ffedeaa80b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/glibc-hwcaps/x86-64-v3/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib/glibc-hwcaps/x86-64-v3/", 0x7ffedeaa80b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/glibc-hwcaps/x86-64-v2/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib/glibc-hwcaps/x86-64-v2/", 0x7ffedeaa80b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib/", {st_mode=S_IFDIR|0755, st_size=642, ...}, 0) = 0
openat(AT_FDCWD, "/usr/lib/glibc-hwcaps/x86-64-v4/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib/glibc-hwcaps/x86-64-v4/", 0x7ffedeaa80b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/glibc-hwcaps/x86-64-v3/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib/glibc-hwcaps/x86-64-v3/", 0x7ffedeaa80b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/glibc-hwcaps/x86-64-v2/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib/glibc-hwcaps/x86-64-v2/", 0x7ffedeaa80b0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libsystemd-core-258.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib/", {st_mode=S_IFDIR|0755, st_size=642, ...}, 0) = 0
writev(2, [{iov_base="/var/cache/src/systemd/build/sys"..., iov_len=36},
           {iov_base=": ", iov_len=2},
           {iov_base="error while loading shared libra"..., iov_len=36},
           {iov_base=": ", iov_len=2},
           {iov_base="libsystemd-core-258.so", iov_len=22},
           {iov_base=": ", iov_len=2},
           {iov_base="cannot open shared object file", iov_len=30},
           {iov_base=": ", iov_len=2},
           {iov_base="No such file or directory", iov_len=25},
           {iov_base="\n", iov_len=1}],
           10/var/cache/src/systemd/build/systemd: error while loading shared libraries: libsystemd-core-258.so: cannot open shared object file: No such file or directory
) = 158
2025-02-20 10:46:23 +00:00
Daan De Meyer
bddfcd9629 mkosi: Do not run unit tests during build by default
We want the incremental builds to be as fast as possible, so let's
not run the unit tests locally during the image build by default.
2025-02-20 10:31:19 +01:00
Daan De Meyer
75ace9fd84 docs: Document how to run the unit tests in HACKING.md 2025-02-20 10:31:19 +01:00
Luca Boccassi
5dbc4f37c5 tree-wide: tweaks to mount point inode creation (#36308)
Some love for make_mount_point_inode_from_xyz() and ports PID 1 over to
it for mount units.

Alternative to #36290
2025-02-19 22:09:52 +00:00
Luca Boccassi
4225242149 repart: add parameter to attach offline verity signature (#36405)
Add --join-signature=hash:sig - when a verity signature partition
has been deferred in a previous run, this allows attaching a signature
that was created offline, for example on a build system like OBS where
the private key is not available to the build process.

Can be specified multiple times, the right partition to act upon will
be selected by matching the data+verity partitions UUIDs with the
provided roothash(es)
2025-02-19 18:12:19 +00:00
Luca Boccassi
09fd125059 repart: add parameter to attach offline verity signatures
Add --join-signature=hash:sig - when a verity signature partition
has been deferred in a previous run, this allows attaching a signature
that was created offline, for example on a build system like OBS where
the private key is not available to the build process.

Can be specified multiple times, the right partition to act upon will
be selected by matching the data+verity partitions UUIDs with the
provided roothash(es)
2025-02-19 16:26:05 +00:00
xinpeng wang
df1ff1c0a0 logind: save seat before applying acl
udev will trigger the uaccess program in 73-seat-late.rules, which
may modify the device's acl permissions. In some cases, udev triggers
the uaccess program when logind is started and active is being set.
At this time, 1) logind sets the user's acl permissions, 2) uaccess
obtains active and sets acl permissions; 3) logind updates seat's
stat_file and writes active. This situation will cause the device to
not have the correct acl permissions, resulting in abnormal situations
such as a black screen. Therefore, it is necessary to write active to
seat's stat file before setting acl.
2025-02-19 16:38:33 +01:00
Lennart Poettering
6750629c2e issue: add trailing empty line
(Make this more alike the version actually shipped in Fedora)
2025-02-19 16:08:39 +01:00
Lennart Poettering
52cd94b9e4 update TODO 2025-02-19 16:08:39 +01:00
Daan De Meyer
049e9587bb mkosi: Update distribution packaging specs for arch, opensuse and fedora (#36428) 2025-02-19 14:42:52 +01:00
Jan Macku
de99f5fbb4 github: bump versions in issue forms 2025-02-19 13:29:48 +00:00
Daan De Meyer
759abb6d52 mkosi: update fedora commit reference
* 6c7c4a510d Do not use dynamic spec generation for non-upstream builds
* 6201755b36 Allow co-installation of systemd-sysusers-standalone and systemd
* eba1721678 Split out -sysusers and -shared
* ac9c438e27 Use dynamic spec generation for triggers
* 3671a5cc79 Move more auxiliary files into subpackages
* 5c40e08728 Remove patch that is already upstream
* 49ec9f3286 Move some files into subpackages
* 2c0b984bf4 Version 257.3
* d66f997915 Add explicit BR: libxcrypt-devel
* 1ffa7bf7c7 Make Georgian mapping patch downstream-only
* de4ae54a34 Backport PR #36194 to add Georgian mapping to kbd-model-map
* cc9bce7893 Drop override of $PATH in the user manager
* d0973df863 Backport patch to emit audit events from systemd-sysusers
* e54ec2f978 Trim changelog entries that are not relevant to users
2025-02-19 13:46:47 +01:00
Luca Boccassi
599750eb51 obs: trigger systemd-suse instead of systemd-fedora
The suse recipe is the odd one out, so now fedora builds with
arch/debian/ubuntu and suse is in its own package
2025-02-18 23:10:00 +00:00
Luca Boccassi
7b0403bef9 network: drop old kernel support (#36402) 2025-02-18 22:39:36 +00:00
Luca Boccassi
6a6d4c3f3c shell completion: add kernel-identify/inspect verbs for bootctl
Follow-up for a05255981b
Follow-up for 3e0a3a0259
2025-02-18 21:40:29 +00:00
Lennart Poettering
47cb765b86 update TODO 2025-02-18 22:33:23 +01:00
Yu Watanabe
18f2d38d5f Journal-remote: modernize source_free() and fix memleak (#36430)
- modernize source_free().
- fix memleak introduced by cfaf78001c. Fixes CID#1591182.
2025-02-19 04:56:15 +09:00
Yu Watanabe
a6eb22968c terminal-util: fix possible NULL pointer dereference
Fixes a bug introduced by 94a2b1cd25.
Fixes CID#1591787.
2025-02-18 18:34:39 +01:00
Yu Watanabe
134bb7bfdf nspawn: unconditionally enable FUSE and use FOREACH_ARRAY() (#36407)
- FUSE is unconditionally enabled in the container, as our kernel base
line (v5.4) supports userns-safe FUSE, which is supported since v4.18.
- Create /dev/net/tun only when it is accessible.
- Replaces several loops with FOREACH_ARRAY().
2025-02-19 02:09:58 +09:00
Yu Watanabe
011a83e42b network: fix KeepConfiguration=yes (#36414)
Fixes a regression in dd6d53a8dc (v257).
Fixes #36411.
2025-02-19 02:09:09 +09:00
Steve Ramage
a4750ae156 network: doc and code typo fixes (#36422)
This fixes some typos in the documentation, both grammar as well as
incorrect field names.
It also changes the casing of CheckSum to Checksum in L2TP to match
other casings.
2025-02-19 02:08:16 +09:00
Yu Watanabe
54258df829 journal-remote: fix memleak
Fixes a bug introduced by cfaf78001c.
Fixes CID#1591182.
2025-02-19 01:00:20 +09:00
Yu Watanabe
ca25c8a5e2 journal-remote: modernize source_free()
- make it return NULL,
- suppress log message about reference counter of writer unless trace
  logging is enabled,
- introduce cleanup function for RemoteSource.
2025-02-19 00:58:24 +09:00
Luca Boccassi
b7a2f8715e dissect: add helper functions to use VeritySettings in hash/set 2025-02-18 14:44:51 +00:00
Yu Watanabe
114d191a17 nspawn: move the accessibility check for device nodes into copy_devnode_one() 2025-02-18 23:35:13 +09:00
Yu Watanabe
c51e472bd4 nspawn: drop unused argument for copy_devnode_one() 2025-02-18 23:24:20 +09:00
Yu Watanabe
9fff6bf59e nspawn: create /dev/net/tun only when it is accessible
Follow-up for 985ea98e7f.

When DevicePolicy= is enabled, but DeviceAllow= for /dev/net/tun is not
specified, bind-mounting the device node from the host system is
meaningless, as it cannot be used in the container anyway.

Let's check the device node is accessible before creating or
bind-mounting.
2025-02-18 23:24:20 +09:00
Yu Watanabe
3cc23a2c23 nspawn: enable FUSE unconditionally
FUSE is userns-safe since kernel v4.18 (da315f6e03988a7127680bbc26e1028991b899b8),
and now our kernel base line is 5.4. Let's drop the logic of checking
the version of FUSE, and unconditionally enable FUSE.
2025-02-18 23:24:20 +09:00
Yu Watanabe
1236f06c42 nspawn: use FOREACH_ARRAY() where applicable 2025-02-18 23:24:20 +09:00
Yu Watanabe
81f637630c network: introduce link_should_mark_config()
This split-out common logic from link_drop_routes() and friends.

This is mostly a refactoring, and not change behavior in most cases.
But slightly change behavior for how foreign nexthops and routing
policy rules are managed.

E.g. when KeepConfiguration=static, previously all foreign nexthops and
routing policy rules were kept, but now only foreign nexthops and rules
with RTPROT_STATIC are kept and others are dropped.

Similary, when KeepConfiguration=dynamic, previously all foreign nexthops
and rules were removed, but now foreign configs with a dynamic protocol
e.g. RTPROT_DHCP are kept, and still configs with RTPROT_STATIC are
dropped.

Currently, we do not set/get/manage protocol for neighbor entries.
Hence, the logic of managing foreign neighbor entries is unchanged.
2025-02-18 23:13:51 +09:00
Yu Watanabe
1cac0676da test-network: add test case for KeepConfiguration=yes with RTPROT_BOOT
For issue #36411.
2025-02-18 23:01:53 +09:00
Yu Watanabe
724faccf45 network/route: do not remove any foreign routes when KeepConfiguration=yes
Without this change, only foreign routes with RTPROT_KERNEL, RTPROT_STATIC,
RTPROT_DHCP, RTPROT_RA, and RTPROT_REDIRECT are kept, and foreign routes with
other protocol e.g. RTPROT_BOOT are removed even if KeepConfiguration=yes.

Fixes a regression in dd6d53a8dc (v257).
Fixes #36411.
2025-02-18 23:01:53 +09:00
Daan De Meyer
0022761c14 mkosi: update opensuse commit reference
* 9002a773f0 Update systemd to version 257.3 / rev 441 via SR 1245900
* 7545891f58 Update systemd to version 257.2 / rev 440 via SR 1243303
* c14020ba43 Update systemd to version 257.2 / rev 439 via SR 1241438
* 3137d3ab3d update 2025-02-06 19:07
2025-02-18 14:16:54 +01:00
Daan De Meyer
840ce150a6 mkosi: update arch commit reference
* 1b4994657d return if not a git repository (skip backports and reverts)
* 9d3374e98b move patch up
* 2416b7d81c upgpkg: 257.3-1: new upstream release
2025-02-18 14:16:28 +01:00
Lennart Poettering
a34ce4842b ci: test new logic 2025-02-18 13:49:24 +01:00