[lxc-devel] [lxd/master] Fix target filenames for recursive push with './' as source
albertodonato on Github
lxc-bot at linuxcontainers.org
Tue Jun 27 10:08:33 UTC 2017
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 313 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170627/5afb310c/attachment.bin>
-------------- next part --------------
From 42859345b99e3c4337837032a451fddcd2803c6e Mon Sep 17 00:00:00 2001
From: Alberto Donato <alberto.donato at canonical.com>
Date: Tue, 27 Jun 2017 11:50:52 +0200
Subject: [PATCH] Clean source path for recursive push
Signed-off-by: Alberto Donato <alberto.donato at canonical.com>
---
lxc/file.go | 1 +
1 file changed, 1 insertion(+)
diff --git a/lxc/file.go b/lxc/file.go
index 28fdeaeeb..fbe09a9ee 100644
--- a/lxc/file.go
+++ b/lxc/file.go
@@ -115,6 +115,7 @@ func (c *fileCmd) recursivePullFile(d lxd.ContainerServer, container string, p s
}
func (c *fileCmd) recursivePushFile(d lxd.ContainerServer, container string, source string, target string) error {
+ source = filepath.Clean(source)
sourceDir, _ := filepath.Split(source)
sourceLen := len(sourceDir)
More information about the lxc-devel
mailing list