[lxc-devel] [lxd/master] Don't change permissions of existing containers directory

freeekanayaka on Github lxc-bot at linuxcontainers.org
Wed Jun 5 14:54:28 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 382 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190605/a24167a1/attachment.bin>
-------------- next part --------------
From e52d996c68e5062181884d92375d9a3503d04781 Mon Sep 17 00:00:00 2001
From: Free Ekanayaka <free.ekanayaka at canonical.com>
Date: Wed, 5 Jun 2019 16:53:03 +0200
Subject: [PATCH] Don't change permissions of existing containers directory

This fixes #5797.

Signed-off-by: Free Ekanayaka <free.ekanayaka at canonical.com>
---
 lxd/storage.go | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lxd/storage.go b/lxd/storage.go
index f8c7e70c45..cc5c29872c 100644
--- a/lxd/storage.go
+++ b/lxd/storage.go
@@ -634,11 +634,10 @@ func createContainerMountpoint(mountPoint string, mountPointSymlink string, priv
 		if err != nil {
 			return err
 		}
-	}
-
-	err = os.Chmod(mountPoint, mode)
-	if err != nil {
-		return err
+		err = os.Chmod(mountPoint, mode)
+		if err != nil {
+			return err
+		}
 	}
 
 	if !mntPointSymlinkExist {


More information about the lxc-devel mailing list