Public bug reported:

If I push a file to a target and the file already exists on the
target, it looks like the file is overwritten but not truncated
leaving you with what is essentially a corrupt file.

Below is an example with lxd 0.20-0ubuntu4.1 on Ubuntu 15.10;
nonestimable-ching is the container and ornery is my host.

| root@nonestimable-ching:~# rm /tmp/test
| root@nonestimable-ching:~#
 
| james@ornery:~$ printf "foobar\n" > test
| james@ornery:~$ cat test
| foobar
| james@ornery:~$ md5sum test
| 14758f1afd44c09b7992073ccf00b43d  test
| james@ornery:~$ lxc file push test nonestimable-ching/tmp/test; echo $?
| 0
| james@ornery:~$
 
| root@nonestimable-ching:~# md5sum /tmp/test
| 14758f1afd44c09b7992073ccf00b43d  /tmp/test
| root@nonestimable-ching:~#
 
| root@nonestimable-ching:~# printf "AAAAAAAAAAAAAAAAAAAAAAAAAA\n" > /tmp/test
| root@nonestimable-ching:~# cat /tmp/test
| AAAAAAAAAAAAAAAAAAAAAAAAAA
| root@nonestimable-ching:~# md5sum /tmp/test
| e661370570e45c75aa7b8a7f3b4fe0ad  /tmp/test
| root@nonestimable-ching:~#
 
| james@ornery:~$ md5sum test
| 14758f1afd44c09b7992073ccf00b43d  test
| james@ornery:~$ lxc file push test nonestimable-ching/tmp/test; echo $?
| 0
| james@ornery:~$
 
| root@nonestimable-ching:~# cat /tmp/test
| foobar
| AAAAAAAAAAAAAAAAAAA
| root@nonestimable-ching:~# md5sum /tmp/test
| 92dd0e4f2f479d24ec33ad43d1645f9a  /tmp/test
| root@nonestimable-ching:~#

** Affects: lxd (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1539710

Title:
  lxc file push results in corrupt target file if it already exists

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lxd/+bug/1539710/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to