[lxc-devel] [lxd/master] Fix bad check for snap paths

stgraber on Github lxc-bot at linuxcontainers.org
Tue Aug 22 20:39:06 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170822/7e6ac16e/attachment.bin>
-------------- next part --------------
From af68223f3ef82576d783795db5010d9739b02e8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 22 Aug 2017 16:38:26 -0400
Subject: [PATCH] Fix bad check for snap paths
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 shared/util.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shared/util.go b/shared/util.go
index d2e2526ca..e49e8d058 100644
--- a/shared/util.go
+++ b/shared/util.go
@@ -105,7 +105,7 @@ func IsUnixSocket(path string) bool {
 // When inside of a snap environment, returns the real path
 func HostPath(path string) string {
 	// Ignore relative paths
-	if len(path) == 0 || path[1] != os.PathSeparator {
+	if len(path) == 0 || path[0] != os.PathSeparator {
 		return path
 	}
 


More information about the lxc-devel mailing list