Bug 1150867
| Summary: | 'copy-file-to-file /src /dest' create file /dest even if command 'copy-file-to-file /src /dest' failed | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Lingfei Kong <lkong> |
| Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 7.1 | CC: | leiwang, mbooth, ptoscano, wshi, yuliu |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libguestfs-1.27.61-1.1.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-03-05 13:45:59 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Lingfei Kong
2014-10-09 05:36:22 UTC
Yes, it should remove the output file along error paths. One line reproducer: $ guestfish -N fs -m /dev/sda1 -- mkdir /src : -copy-file-to-file /src /dest : ll / If the bug exists, then /dest is shown in the output: libguestfs: error: copy_file_to_file: read: /src: Is a directory total 18 drwxr-xr-x 4 root root 1024 Oct 9 08:36 . drwxr-xr-x 19 root root 4096 Oct 9 08:36 .. -rw-r--r-- 1 root root 0 Oct 9 08:36 dest <--- NOTE drwx------ 2 root root 12288 Oct 9 08:36 lost+found drwxr-xr-x 2 root root 1024 Oct 9 08:36 src If the bug is fixed, then /dest is not shown because it has been deleted: libguestfs: error: copy_file_to_file: read: /src: Is a directory total 18 drwxr-xr-x 4 root root 1024 Oct 9 08:37 . drwxr-xr-x 19 root root 4096 Oct 9 08:37 .. drwx------ 2 root root 12288 Oct 9 08:37 lost+found drwxr-xr-x 2 root root 1024 Oct 9 08:37 src Normal file copies still work: $ guestfish -N fs -m /dev/sda1 -- fill-pattern "12345" 10000 /src : copy-file-to-file /src /dest : ll / total 37 drwxr-xr-x 3 root root 1024 Oct 9 08:38 . drwxr-xr-x 19 root root 4096 Oct 9 08:38 .. -rw-r--r-- 1 root root 10000 Oct 9 08:38 dest drwx------ 2 root root 12288 Oct 9 08:38 lost+found -rw-r--r-- 1 root root 10000 Oct 9 08:38 src Upstream fix: https://github.com/libguestfs/libguestfs/commit/4d4cada65a09dd40940aa021ba7a52b5fbf266be Verified with libguestfs-1.27.62-1.1.el7 Steps to verify: 1. #guestfish -N fs -m /dev/sda1 -- mkdir /src : -copy-file-to-file /src /dest : ll / libguestfs: error: copy_file_to_file: read: /src: Is a directory total 18 drwxr-xr-x 4 root root 1024 Oct 13 06:25 . drwxr-xr-x 19 root root 4096 Oct 13 06:25 .. drwx------ 2 root root 12288 Oct 13 06:25 lost+found drwxr-xr-x 2 root root 1024 Oct 13 06:25 src dest was not created if src is a directory. 2. guestfish -N fs -m /dev/sda1 -- fill-pattern "12345" 10000 /src : copy-file-to-file /src /dest : ll / total 37 drwxr-xr-x 3 root root 1024 Oct 13 06:26 . drwxr-xr-x 19 root root 4096 Oct 13 06:26 .. -rw-r--r-- 1 root root 10000 Oct 13 06:26 dest drwx------ 2 root root 12288 Oct 13 06:26 lost+found -rw-r--r-- 1 root root 10000 Oct 13 06:26 src dest was created if src is a file. So bug is fixed Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-0303.html |