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

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) ===
Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From ba4c0c8b397217ef3086cd2a5cc06131e394c635 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Mon, 23 Oct 2017 18:11:00 +0200
Subject: [PATCH] If running as root in the snap, use /proc/1/root
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 shared/util.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/shared/util.go b/shared/util.go
index ac32d967c..e97b2db09 100644
--- a/shared/util.go
+++ b/shared/util.go
@@ -143,6 +143,10 @@ func HostPath(path string) string {
                }
        }
 
+       if os.Geteuid() == 0 {
+               return fmt.Sprintf("/proc/1/root%s", path)
+       }
+
        return fmt.Sprintf("/var/lib/snapd/hostfs%s", path)
 }
 
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to