]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Fix rdev field in cpio format for device nodes 1388/head
authorMichael Forney <mforney@mforney.org>
Fri, 29 May 2020 21:54:05 +0000 (14:54 -0700)
committerMichael Forney <mforney@mforney.org>
Fri, 29 May 2020 22:11:07 +0000 (15:11 -0700)
commit1ef7a57a7024af4ae165e07fa10f3984c41fb9f6
treee4c1a54d7f3a0bf70c5291479503b89530b393e8
parent48c375370bb5da0509148bb2ee0075b818e2094e
Fix rdev field in cpio format for device nodes

Currently, the rdev field is set from archive_entry_dev, which is
the device number of the filesystem containing the device node, not
the device itself. It should instead use archive_entry_rdev.

Here's an example demonstrating the problem:

$ ls -l /dev/null
crw-rw-rw-    1 root     root        1,    3 May 26 02:03 /dev/null
$ bsdtar --format=cpio -cf null.cpio /dev/null
bsdtar: Removing leading '/' from member names
$ bsdtar -tvf null.cpio
crw-rw-rw-  1 0      0         0,6 May 26 02:03 dev/null
libarchive/archive_write_set_format_cpio.c
libarchive/test/test_write_format_cpio.c