[lxc-devel] [lxd/master] proxy: Fix environment handling

stgraber on Github lxc-bot at linuxcontainers.org
Wed Jan 24 22:28:15 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 370 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180124/93a005a9/attachment.bin>
-------------- next part --------------
From f30b69794acf69354baa42f330108ea0426a5a1f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Wed, 24 Jan 2018 17:27:38 -0500
Subject: [PATCH] proxy: Fix environment handling
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #4186

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

diff --git a/lxd/main_proxy.go b/lxd/main_proxy.go
index 622419b35..4741f2415 100644
--- a/lxd/main_proxy.go
+++ b/lxd/main_proxy.go
@@ -10,6 +10,7 @@ import (
 	"syscall"
 
 	"github.com/lxc/lxd/shared"
+	"github.com/lxc/lxd/lxd/util"
 )
 
 func cmdProxyDevStart(args *Args) error {
@@ -56,7 +57,7 @@ func cmdProxyDevStart(args *Args) error {
 		args.Params[4] = strconv.Itoa(int(newFd))
 		execArgs := append([]string{"lxd", "forkproxy"}, args.Params...)
 
-		err = syscall.Exec("/proc/self/exe", execArgs, []string{})
+		err = syscall.Exec(util.GetExecPath(), execArgs, os.Environ())
 		if err != nil {
 			return fmt.Errorf("failed to re-exec: %v", err)
 		}


More information about the lxc-devel mailing list