[Bug 9306] New: cpio 1.25.0 doesn't preserve file ownership

bugzilla at busybox.net bugzilla at busybox.net
Tue Sep 27 10:36:49 UTC 2016


https://bugs.busybox.net/show_bug.cgi?id=9306

            Bug ID: 9306
           Summary: cpio 1.25.0 doesn't preserve file ownership
           Product: Busybox
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: busybox at niksoggia.it
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

Created attachment 6731
  --> https://bugs.busybox.net/attachment.cgi?id=6731&action=edit
bugfix

# touch 1 2 3
# chown 11:111 1
# chown 22:222 2
# chown 33:333 3
# echo -e '1\n2\n3' | cpio -o -H newc | busybox cpio -v -t
1 block
-rw-r--r-- 0/0         0 2016-09-27 00:00:00 1
-rw-r--r-- 0/0         0 2016-09-27 00:00:00 2
-rw-r--r-- 0/0         0 2016-09-27 00:00:00 3
1 blocks

correct output should be:

-rw-r--r-- 11/111         0 2016-09-27 00:00:00 1
-rw-r--r-- 22/222         0 2016-09-27 00:00:00 2
-rw-r--r-- 33/333         0 2016-09-27 00:00:00 3

struct archive_handle is memset with zeroes when created.
archive_handle->cpio__owner has to be initialized explicitly otherwise any file
will be extracted (or listed) with owner=0 and group=0.
here is my proposed solution:

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list