[lxc-devel] [lxd/master] lxc: Respect HOME if set

stgraber on Github lxc-bot at linuxcontainers.org
Sat Jul 22 07:57:01 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/20170722/5dc6eb47/attachment.bin>
-------------- next part --------------
From 604bfcb21da4b96ff923ff2cdbffd87dee09a82c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sat, 22 Jul 2017 09:55:49 +0200
Subject: [PATCH] lxc: Respect HOME if set
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>
---
 lxc/main.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lxc/main.go b/lxc/main.go
index d5b940fca..7d4dfeef8 100644
--- a/lxc/main.go
+++ b/lxc/main.go
@@ -52,6 +52,8 @@ func run() error {
 	var configDir string
 	if os.Getenv("LXD_CONF") != "" {
 		configDir = os.Getenv("LXD_CONF")
+	} else if os.Getenv("HOME") != "" {
+		configDir = path.Join(os.Getenv("HOME"), ".config", "lxc")
 	} else {
 		user, err := user.Current()
 		if err != nil {


More information about the lxc-devel mailing list