chiark / gitweb /
namespace: when setting up an inaccessible mount point, unmounting everything below
[elogind.git] / src / core / namespace.c
index b6deab7081166a023424511676f0b2a93df96dea..fcbfd87d4768b1c460d4f246988292acfd80bcfc 100644 (file)
@@ -284,6 +284,12 @@ static int apply_mount(
                 return mount_dev(m);
 
         case INACCESSIBLE:
+
+                /* First, get rid of everything that is below if there
+                 * is anything... Then, overmount it with an
+                 * inaccessible directory. */
+                umount_recursive(m->path, 0);
+
                 what = "/run/systemd/inaccessible";
                 break;