From: DaanDeMeyer Date: Fri, 4 Jul 2025 19:21:35 +0000 (+0200) Subject: nspawn: Use in_child_chown() in one more place X-Git-Tag: v258-rc1~114^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F38152%2Fhead;p=thirdparty%2Fsystemd.git nspawn: Use in_child_chown() in one more place --- diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index f0cfd4f1aad..efe6e535c43 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2485,7 +2485,7 @@ static int setup_credentials(const char *root) { if (fchmod(fd, world_readable ? 0444 : 0400) < 0) return log_error_errno(errno, "Failed to adjust access mode of %s: %m", j); - if (arg_userns_mode != USER_NAMESPACE_NO) + if (in_child_chown()) if (fchown(fd, arg_uid_shift, arg_uid_shift) < 0) return log_error_errno(errno, "Failed to adjust ownership of %s: %m", j); }