The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/5435

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Part of https://github.com/lxc/lxc/issues/2798

Signed-off-by: Stéphane Graber <[email protected]>
From a8835a17f507386aff8a8133c2e9191c8cba27c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <[email protected]>
Date: Sat, 26 Jan 2019 09:01:39 -0500
Subject: [PATCH] lxd/containers: Fix lxc.mount.entry for musl
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Part of https://github.com/lxc/lxc/issues/2798

Signed-off-by: Stéphane Graber <[email protected]>
---
 lxd/container_lxc.go | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go
index 6440c69411..81489308d3 100644
--- a/lxd/container_lxc.go
+++ b/lxd/container_lxc.go
@@ -1030,7 +1030,7 @@ func (c *containerLXC) initLXC(config bool) error {
                "/sys/kernel/security"}
 
        if c.IsPrivileged() && !c.state.OS.RunningInUserNS {
-               err = lxcSetConfigItem(cc, "lxc.mount.entry", "mqueue 
dev/mqueue mqueue rw,relatime,create=dir,optional")
+               err = lxcSetConfigItem(cc, "lxc.mount.entry", "mqueue 
dev/mqueue mqueue rw,relatime,create=dir,optional 0 0")
                if err != nil {
                        return err
                }
@@ -1044,12 +1044,12 @@ func (c *containerLXC) initLXC(config bool) error {
                }
 
                if shared.IsDir(mnt) {
-                       err = lxcSetConfigItem(cc, "lxc.mount.entry", 
fmt.Sprintf("%s %s none rbind,create=dir,optional", mnt, 
strings.TrimPrefix(mnt, "/")))
+                       err = lxcSetConfigItem(cc, "lxc.mount.entry", 
fmt.Sprintf("%s %s none rbind,create=dir,optional 0 0", mnt, 
strings.TrimPrefix(mnt, "/")))
                        if err != nil {
                                return err
                        }
                } else {
-                       err = lxcSetConfigItem(cc, "lxc.mount.entry", 
fmt.Sprintf("%s %s none bind,create=file,optional", mnt, 
strings.TrimPrefix(mnt, "/")))
+                       err = lxcSetConfigItem(cc, "lxc.mount.entry", 
fmt.Sprintf("%s %s none bind,create=file,optional 0 0", mnt, 
strings.TrimPrefix(mnt, "/")))
                        if err != nil {
                                return err
                        }
@@ -1105,12 +1105,12 @@ func (c *containerLXC) initLXC(config bool) error {
                 * mount extra /proc and /sys to work around kernel
                 * restrictions on remounting them when covered
                 */
-               err = lxcSetConfigItem(cc, "lxc.mount.entry", "proc 
dev/.lxc/proc proc create=dir,optional")
+               err = lxcSetConfigItem(cc, "lxc.mount.entry", "proc 
dev/.lxc/proc proc create=dir,optional 0 0")
                if err != nil {
                        return err
                }
 
-               err = lxcSetConfigItem(cc, "lxc.mount.entry", "sys dev/.lxc/sys 
sysfs create=dir,optional")
+               err = lxcSetConfigItem(cc, "lxc.mount.entry", "sys dev/.lxc/sys 
sysfs create=dir,optional 0 0")
                if err != nil {
                        return err
                }
@@ -1542,7 +1542,7 @@ func (c *containerLXC) initLXC(config bool) error {
                                fmt.Sprintf("%s %s %s",
                                        shared.EscapePathFstab(sourceDevPath),
                                        
shared.EscapePathFstab(relativeDestPath),
-                                       "none bind,create=file"))
+                                       "none bind,create=file 0 0"))
                        if err != nil {
                                return err
                        }
@@ -1728,9 +1728,10 @@ func (c *containerLXC) initLXC(config bool) error {
                                }
 
                                err = lxcSetConfigItem(cc, "lxc.mount.entry",
-                                       fmt.Sprintf("%s %s none %sbind,%s",
+                                       fmt.Sprintf("%s %s none %sbind,%s 0 0",
                                                
shared.EscapePathFstab(sourceDevPath),
-                                               
shared.EscapePathFstab(relativeDestPath), rbind,
+                                               
shared.EscapePathFstab(relativeDestPath),
+                                               rbind,
                                                strings.Join(options, ",")))
                                if err != nil {
                                        return err
@@ -1854,7 +1855,7 @@ func (c *containerLXC) setupUnixDevice(prefix string, dev 
types.Device, major in
 
        devPath := shared.EscapePathFstab(paths[0])
        tgtPath := shared.EscapePathFstab(paths[1])
-       val := fmt.Sprintf("%s %s none bind,create=file", devPath, tgtPath)
+       val := fmt.Sprintf("%s %s none bind,create=file 0 0", devPath, tgtPath)
 
        return lxcSetConfigItem(c.c, "lxc.mount.entry", val)
 }
@@ -6925,7 +6926,7 @@ func (c *containerLXC) 
addInfinibandDevicesPerPort(deviceName string, ifDev *IBF
 
                // inform liblxc about the mount
                err = lxcSetConfigItem(c.c, "lxc.mount.entry",
-                       fmt.Sprintf("%s %s none bind,create=file",
+                       fmt.Sprintf("%s %s none bind,create=file 0 0",
                                shared.EscapePathFstab(devPath),
                                shared.EscapePathFstab(relDestPath)))
                if err != nil {
@@ -6970,7 +6971,7 @@ func (c *containerLXC) 
addInfinibandDevicesPerFun(deviceName string, ifDev *IBF,
                }
 
                // inform liblxc about the mount
-               err := lxcSetConfigItem(c.c, "lxc.mount.entry", fmt.Sprintf("%s 
%s none bind,create=file", hostDevPath, relativeDestPath))
+               err := lxcSetConfigItem(c.c, "lxc.mount.entry", fmt.Sprintf("%s 
%s none bind,create=file 0 0", hostDevPath, relativeDestPath))
                if err != nil {
                        return err
                }
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to