You can register whatever process you want in the user machined instance
that is running in the same namespace as pid 1 as machined won't be allowed
to do anything privileged anyway that could be dangerous when running as a user
instance.
We have to skip the check as we user machined instances don't have
privileges to inspect pid1's user namespaces.
* do not need to check the caller's uid, as that will be checked by polkit, and if they machine's
* and the caller's do not match, authorization will be required. It's only the case where the
* caller owns the machine that will be shortcut and needs to be checked here. */
- if (m->uid != 0 && m->class != MACHINE_HOST) {
+ if (m->manager->runtime_scope != RUNTIME_SCOPE_USER && m->uid != 0 && m->class != MACHINE_HOST) {
r = pidref_in_same_namespace(&PIDREF_MAKE_FROM_PID(1), &m->leader, NAMESPACE_USER);
if (r < 0)
return log_debug_errno(