[lxc-devel] [lxd/master] lxd/backup: Call tar with --numeric-ids

stgraber on Github lxc-bot at linuxcontainers.org
Sun Aug 18 18:54:58 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 476 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190818/ec47311b/attachment.bin>
-------------- next part --------------
From d46ee72870c8ac059fd9539b6a3994f12ae7e5a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sun, 18 Aug 2019 14:54:11 -0400
Subject: [PATCH] lxd/backup: Call tar with --numeric-ids
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Otherwise the encoded user/group names may differ on target system
leading to a rewrite of uid/gid...

Closes #6097

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

diff --git a/lxd/backup.go b/lxd/backup.go
index 36eba51b28..26e996bad1 100644
--- a/lxd/backup.go
+++ b/lxd/backup.go
@@ -385,7 +385,7 @@ func backupCreateTarball(s *state.State, path string, backup backup) error {
 		os.RemoveAll(backupPath)
 	}()
 
-	args := []string{"-cf", backupPath, "--xattrs", "-C", path, "--transform", "s,^./,backup/,", "."}
+	args := []string{"-cf", backupPath, "--numeric-ids", "--xattrs", "-C", path, "--transform", "s,^./,backup/,", "."}
 	_, err = shared.RunCommand("tar", args...)
 	if err != nil {
 		return err


More information about the lxc-devel mailing list