diff options
author | Lennart Poettering <lennart@poettering.net> | 2025-01-17 09:50:01 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2025-01-17 11:12:24 +0100 |
commit | d58577d45e6004979ef7b05b34439bbe5c6b59c7 (patch) | |
tree | 9c02898e878dbdcfacf11052a7b68eecf1a5127b | |
parent | tree-wide: switch various uses of mkdtemp() over to mkdtemp_malloc() (diff) | |
download | systemd-d58577d45e6004979ef7b05b34439bbe5c6b59c7.tar.xz systemd-d58577d45e6004979ef7b05b34439bbe5c6b59c7.zip |
nspawn: assorted coding style fixes
-rw-r--r-- | src/nspawn/nspawn-mount.c | 6 | ||||
-rw-r--r-- | src/nspawn/nspawn.c | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/nspawn/nspawn-mount.c b/src/nspawn/nspawn-mount.c index 808380af76..f64d6b48a6 100644 --- a/src/nspawn/nspawn-mount.c +++ b/src/nspawn/nspawn-mount.c @@ -150,7 +150,7 @@ static int allocate_temporary_source(CustomMount *m) { int custom_mount_prepare_all(const char *dest, CustomMount *l, size_t n) { int r; - /* Prepare all custom mounts. This will make source we know all temporary directories. This is called in the + /* Prepare all custom mounts. This will make sure we know all temporary directories. This is called in the * parent process, so that we know the temporary directories to remove on exit before we fork off the * children. */ @@ -159,9 +159,7 @@ int custom_mount_prepare_all(const char *dest, CustomMount *l, size_t n) { /* Order the custom mounts, and make sure we have a working directory */ typesafe_qsort(l, n, custom_mount_compare); - for (size_t i = 0; i < n; i++) { - CustomMount *m = l + i; - + FOREACH_ARRAY(m, l, n) { /* /proc we mount in the inner child, i.e. when we acquired CLONE_NEWPID. All other mounts we mount * already in the outer child, so that the mounts are already established before CLONE_NEWPID and in * particular CLONE_NEWUSER. This also means any custom mounts below /proc also need to be mounted in diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 7ceda0b30c..5ab04b121a 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -3437,7 +3437,7 @@ static int inner_child( return r; } - r = mount_all(NULL, + r = mount_all(/* dest= */ NULL, arg_mount_settings | MOUNT_IN_USERNS, arg_uid_shift, arg_selinux_apifs_context); |