]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: no need to make top-level directory a bind mount if we just dissected an...
authorLennart Poettering <lennart@poettering.net>
Wed, 19 Dec 2018 00:03:52 +0000 (01:03 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 1 Mar 2019 13:11:07 +0000 (14:11 +0100)
src/nspawn/nspawn.c

index 18ba76f0cd673ae5de066fec2f1d25b968e09a23..f668fffb6e0826433bf331298196d42fd7bf3265 100644 (file)
@@ -2896,10 +2896,12 @@ static int outer_child(
                          "Selected user namespace base " UID_FMT " and range " UID_FMT ".", arg_uid_shift, arg_uid_range);
         }
 
-        /* Turn directory into bind mount */
-        r = mount_verbose(LOG_ERR, directory, directory, NULL, MS_BIND|MS_REC, NULL);
-        if (r < 0)
-                return r;
+        if (!dissected_image) {
+                /* Turn directory into bind mount */
+                r = mount_verbose(LOG_ERR, directory, directory, NULL, MS_BIND|MS_REC, NULL);
+                if (r < 0)
+                        return r;
+        }
 
         r = setup_pivot_root(
                         directory,