When using --slice-inherit, setting arg_slice would inadvertently munge
user.slice into the current user slice, usually producing a slice name
like user-1000-user.slice. This is treated as a user-UID slice by
user-.slice.d/10-defaults.conf, resulting in a strange description:
literally "User slice for UID user" (instead of an actual user UID).
Keep arg_slice empty when using --slice-inherit so that we actually
inherit from the relevant slice instead of a munged version.
Fixes: #42601
strv_free_and_replace(arg_cmdline, l);
- if (!arg_slice) {
+ if (!custom_slice) {
arg_slice = strdup(SPECIAL_USER_SLICE);
if (!arg_slice)
return log_oom();