1
0
mirror of https://github.com/systemd/systemd synced 2026-03-19 03:24:45 +01:00

Compare commits

...

5 Commits

Author SHA1 Message Date
David Santamaría Rogado
3ae637c42a quirks: touchpad: Set Duet 3 bt touchpad internal
The touchpad is in a keyboard and touchpad combo that can be attached and
detached in a convertible device.
2026-01-04 06:10:45 +09:00
DaanDeMeyer
4d6274a6f4 repart: Don't silence mkfs.erofs if on a tty
mkfs.erofs is only sometimes verbose when not on a TTY, so let's not
silence it if we're on a TTY.
2026-01-04 05:17:19 +09:00
DaanDeMeyer
c8911b745c mkfs-util: Add one more log message
Formatting a filesystem might take a long time, so let's also log a
message when we start formatting it.
2026-01-04 05:17:19 +09:00
Mike Yuan
08c3010399
elf-util: fix alignment 2026-01-03 20:08:12 +01:00
Yu Watanabe
cb39d66ec8 core: do not provide non-dynamic user through DBus/Varlink
With a service with DynamicUser= with static user or group, e.g.,
```
$ systemd-run -p DynamicUser=yes -p Group=disk sleep infinity
```
previously the lookup by name and ID through DBus/Varlink are inconsistent:
```
$ busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LookupDynamicUserByUID "u" 6
Call failed: Dynamic user ID 6 does not exist.

$ busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LookupDynamicUserByName "s" disk
u 6

$ userdbctl group 6
  Group name: disk
 Disposition: system
         GID: 6
   Passwords: 1
     Service: io.systemd.NameServiceSwitch

$ userdbctl group disk
  Group name: disk
 Disposition: dynamic
         GID: 6
 Description: Dynamic Group
     Service: io.systemd.DynamicUser
```

With this change, the results of these methods are consistent.

Fixes #40228.
2026-01-03 19:57:44 +01:00
7 changed files with 44 additions and 9 deletions

View File

@ -52,6 +52,12 @@ touchpad:usb:v05acp0324:*
touchpad:usb:v044ep1221:* touchpad:usb:v044ep1221:*
ID_INPUT_TOUCHPAD_INTEGRATION=external ID_INPUT_TOUCHPAD_INTEGRATION=external
###########################################################
# Lenovo IdeaPad Duet3 10IGL5 (82AT)
###########################################################
touchpad:bluetooth:v17efp60fa:*
ID_INPUT_TOUCHPAD_INTEGRATION=internal
########################################################### ###########################################################
# Logitech # Logitech
########################################################### ###########################################################

View File

@ -695,11 +695,20 @@ int dynamic_user_lookup_name(Manager *m, const char *name, uid_t *ret) {
if (!d) if (!d)
return -ESRCH; return -ESRCH;
r = dynamic_user_current(d, ret); uid_t uid;
r = dynamic_user_current(d, &uid);
if (r == -EAGAIN) /* not realized yet? */ if (r == -EAGAIN) /* not realized yet? */
return -ESRCH; return -ESRCH;
if (r < 0)
return r; return r;
if (!uid_is_dynamic(uid))
return -ESRCH;
if (ret)
*ret = uid;
return 0;
} }
int dynamic_creds_make(Manager *m, const char *user, const char *group, DynamicCreds **ret) { int dynamic_creds_make(Manager *m, const char *user, const char *group, DynamicCreds **ret) {

View File

@ -7,6 +7,7 @@
#include "json-util.h" #include "json-util.h"
#include "manager.h" #include "manager.h"
#include "string-util.h" #include "string-util.h"
#include "uid-classification.h"
#include "user-util.h" #include "user-util.h"
#include "varlink-dynamic-user.h" #include "varlink-dynamic-user.h"
@ -91,6 +92,9 @@ int vl_method_get_user_record(sd_varlink *link, sd_json_variant *parameters, sd_
if (r < 0) if (r < 0)
return r; return r;
if (!uid_is_dynamic(uid))
continue;
if (!user_match_lookup_parameters(&p, d->name, uid)) if (!user_match_lookup_parameters(&p, d->name, uid))
continue; continue;
@ -199,6 +203,9 @@ int vl_method_get_group_record(sd_varlink *link, sd_json_variant *parameters, sd
if (r < 0) if (r < 0)
return r; return r;
if (!gid_is_dynamic((gid_t) uid))
continue;
if (!group_match_lookup_parameters(&p, d->name, (gid_t) uid)) if (!group_match_lookup_parameters(&p, d->name, (gid_t) uid))
continue; continue;

View File

@ -2730,7 +2730,7 @@ static MakeFileSystemFlags partition_mkfs_flags(const Partition *p) {
if (arg_discard) if (arg_discard)
flags |= MKFS_DISCARD; flags |= MKFS_DISCARD;
if (streq(p->format, "erofs") && !DEBUG_LOGGING) if (streq(p->format, "erofs") && !DEBUG_LOGGING && !isatty_safe(STDERR_FILENO))
flags |= MKFS_QUIET; flags |= MKFS_QUIET;
FOREACH_ARRAY(cf, p->copy_files, p->n_copy_files) FOREACH_ARRAY(cf, p->copy_files, p->n_copy_files)

View File

@ -857,7 +857,8 @@ int parse_elf_object(
* bound since the core files have an upper size limit. It's also not doing any * bound since the core files have an upper size limit. It's also not doing any
* system call or interacting with the system in any way, besides reading from * system call or interacting with the system in any way, besides reading from
* the file descriptor and writing into these four pipes. */ * the file descriptor and writing into these four pipes. */
r = pidref_safe_fork_full("(sd-parse-elf)", r = pidref_safe_fork_full(
"(sd-parse-elf)",
/* stdio_fds= */ NULL, /* stdio_fds= */ NULL,
(int[]) { fd, error_pipe[1], return_pipe[1], package_metadata_pipe[1], dlopen_metadata_pipe[1] }, (int[]) { fd, error_pipe[1], return_pipe[1], package_metadata_pipe[1], dlopen_metadata_pipe[1] },
5, 5,

View File

@ -679,6 +679,8 @@ int make_filesystem(
fork_flags |= FORK_NEW_MOUNTNS; fork_flags |= FORK_NEW_MOUNTNS;
} }
log_info("Formatting %s as %s", node, fstype);
if (DEBUG_LOGGING) { if (DEBUG_LOGGING) {
_cleanup_free_ char *j = NULL; _cleanup_free_ char *j = NULL;

View File

@ -59,3 +59,13 @@ if [[ ! -v ASAN_OPTIONS ]]; then
assert_rc 2 systemd-run -q -t --property SystemCallFilter=~open_tree getent group definitelynotarealgroup assert_rc 2 systemd-run -q -t --property SystemCallFilter=~open_tree getent group definitelynotarealgroup
systemctl start systemd-userdbd.socket systemd-userdbd.service systemctl start systemd-userdbd.socket systemd-userdbd.service
fi fi
# For issue 40228
UNIT="sleep$RANDOM"
DISK_GID=$(userdbctl -j group disk | jq .gid)
systemd-run -p DynamicUser=yes -p Group=disk -u "$UNIT" sleep infinity
userdbctl group disk | grep -F 'io.systemd.NameServiceSwitch' >/dev/null
userdbctl group "$DISK_GID" | grep -F 'io.systemd.NameServiceSwitch' >/dev/null
(! busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LookupDynamicUserByName "s" disk)
(! busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager LookupDynamicUserByUID "u" "$DISK_GID")
systemctl stop "$UNIT"