summary refs log tree commit diff
path: root/pkgs/development/libraries/libvirt/securtyfs_userns.patch
blob: 2723334f94afdf9b96df40bfe5c3c05dbd2883fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -750,7 +750,7 @@ err:
 }
 
 
-static int lxcContainerMountBasicFS(void)
+static int lxcContainerMountBasicFS(bool userns_enabled)
 {
     const struct {
         const char *src;
@@ -801,6 +801,9 @@ static int lxcContainerMountBasicFS(void)
             continue;
 #endif
 
+        if (STREQ(mnts[i].src, "securityfs") && userns_enabled)
+            continue;
+
         if (virFileMakePath(mnts[i].dst) < 0) {
             virReportSystemError(errno,
                                  _("Failed to mkdir %s"),
@@ -1530,7 +1533,7 @@ static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef,
         goto cleanup;
 
     /* Mounts the core /proc, /sys, etc filesystems */
-    if (lxcContainerMountBasicFS() < 0)
+    if (lxcContainerMountBasicFS(vmDef->idmap.nuidmap) < 0)
         goto cleanup;
 
     /* Mounts /proc/meminfo etc sysinfo */