The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/3459
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) ===
From 9f4b901ba8b2ec93234aa1db9771a29b41fa49b9 Mon Sep 17 00:00:00 2001 From: Alberto Donato <[email protected]> Date: Tue, 27 Jun 2017 11:50:52 +0200 Subject: [PATCH 1/2] Clean source path for recursive push Signed-off-by: Alberto Donato <[email protected]> --- 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) From 1f974315d51cd5133c8c94fdb6fa056e8fd01642 Mon Sep 17 00:00:00 2001 From: Christian Brauner <[email protected]> Date: Tue, 27 Jun 2017 21:03:54 +0200 Subject: [PATCH 2/2] test: add tests for ./ file push Signed-off-by: Christian Brauner <[email protected]> --- test/suites/filemanip.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/suites/filemanip.sh b/test/suites/filemanip.sh index 2ad9dd7da..7ee7aeb5c 100644 --- a/test/suites/filemanip.sh +++ b/test/suites/filemanip.sh @@ -34,6 +34,16 @@ test_filemanip() { lxc exec filemanip -- rm -rf /tmp/ptest/source + lxc file push -p -r "./${TEST_DIR}"/source filemanip/tmp/ptest + + [ "$(lxc exec filemanip -- stat -c "%u" /tmp/ptest/source)" = "$(id -u)" ] + [ "$(lxc exec filemanip -- stat -c "%g" /tmp/ptest/source)" = "$(id -g)" ] + [ "$(lxc exec filemanip -- stat -c "%u" /tmp/ptest/source/another_level)" = "1000" ] + [ "$(lxc exec filemanip -- stat -c "%g" /tmp/ptest/source/another_level)" = "1000" ] + [ "$(lxc exec filemanip -- stat -c "%a" /tmp/ptest/source)" = "755" ] + + lxc exec filemanip -- rm -rf /tmp/ptest/source + # Special case where we are in the same directory as the one we are currently # created. oldcwd=$(pwd)
_______________________________________________ lxc-devel mailing list [email protected] http://lists.linuxcontainers.org/listinfo/lxc-devel
