Commit Graph

79514 Commits

Author SHA1 Message Date
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
Lennart Poettering
4e24796b5a mount-tool: add explicitly control of path canonicalization
With this the default canonicalization of paths can be turned off,
giving users explicit control on what shall happen if symlinks are
encountered within a path.
2025-02-18 13:49:24 +01:00
Lennart Poettering
61178346e6 mount-tool: modernize umount and make sure it works for bind mounted files
So far, "systemd-umount" executed on a bind mounted file would assume it
is supposed to unmount a loopback mounted file system. Let's address
that by instead checking if the file is a mount.
2025-02-18 13:49:24 +01:00
Lennart Poettering
66b5e7dfaa catalog: assign a proper message ID for mounts on symlinked paths
For some reason we reused the non-empty catalog entry so far, which is
plain wrong. Correct that.
2025-02-18 13:49:24 +01:00
Lennart Poettering
38c35970b1 core: port mount unit inode creation to make_mount_point_inode_from_mode() too
This also ports over things to use chase() to create/pin the underlying
to mount, and in particular checks that the path does not contain any
symlinks. That's crucial since we cannot allow mounts to be established
with that, since it would mean we couldn't recognize the entries in
/proc/self/mountinfo anymore.
2025-02-18 13:49:24 +01:00
Lennart Poettering
3075ea0bc9 mount-util: refactor make_mount_point_inode_from_xyz()
This replaces make_mount_point_inode_from_stat() by
make_mount_point_inode_from_mode() and makes it take a single mode_t
rather than a "struct stat". Moreover, at an "atfd" style directory
parameter.

Then port all users over to new feature, and in particular make use of
the directory fd: use chase() to create and pin parent directories first where
needed.
2025-02-18 13:49:24 +01:00
Lennart Poettering
8e0193aabf tree-wide: pass EBADF to fd params of namespace_fork() 2025-02-18 12:11:00 +01:00
Lennart Poettering
fff6dfc75e timedated: rework clock change overflow check
Let's use explicit language constructs to test for overflow, the
previous code was ultimately relying on undefined behaviour.
2025-02-18 11:22:34 +01:00
Lennart Poettering
0df15b843e Firstboot tweaklets (#36424) 2025-02-18 11:22:11 +01:00
Marco Trevisan (Treviño)
bd887a75d4 man/org.freedesktop.systemd1.xml: Clarify the behavior of Subscribe()
It was unclear that it was applied to standard signals too, and this
lead to unexpected behavior.

See: https://github.com/systemd/systemd/pull/36366
2025-02-18 09:56:11 +00:00
Lennart Poettering
787904d078 terminal-util: output newline at end of "Press any key to proceed" message
So far we'd leave the cursor at the end of the Press any key to proceed
message as long as the user didn't type in anything yet, and generated
the newline only after.

Let's switch this around: let's output the newline before.

This should make boot-time output nicer since it means concurrent output
while we wait will start at the beginning of line, and not in the middle.
2025-02-18 09:19:03 +01:00
Lennart Poettering
0e7dd5aa4d homectl: when asking for a user pw for an initial homed account at boot, don't insist on strong password
It's just very annoying during debugging, and also unnecessary.
2025-02-18 09:19:03 +01:00