Public bug reported:

Binary package hint: cpio

The --sparse argument for cpio creates disk files with holes if the
input file from the archive has large runs of ASCII 0.  I recently
switched to Ubuntu 7.04 from Fedora Core 3, and scripts using this
feature now produce the error:

cat ../arch | cpio --extract --sparse
cpio: --sparse is meaningless with --extract

They also refuse to unpack the archive.  But, --extract is the only
context in which --sparse *is* meaningful.  The documentation states:

       cpio  {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H format]
       [-M message]  [-R  [user][:.][group]]  [-I  [EMAIL PROTECTED]:]archive]  
[-F
       [EMAIL PROTECTED]:]archive]  [EMAIL PROTECTED]:]archive] [--make-directo-
       ries]  [--nonmatching]  [--preserve-modification-time]  [--numeric-uid-
       gid] [--rename] [-t|--list] [--swap-bytes] [--swap] [--dot] [--uncondi-
       tional]  [--verbose]  [--block-size=blocks]  [--swap-halfwords]  [--io-
       size=bytes]           [--pattern-file=file]           [--format=format]
       [--owner=[user][:.][group]]  [--no-preserve-owner]  [--message=message]
       [--force-local]   [--no-absolute-filenames]   [--sparse]   [--only-ver-
       ify-crc] [--quiet] [--rsh-command=command] [--help]  [--version]  [pat-
       tern...] [< archive]

       cpio  {-p|--pass-through}  [-0adlmuvLV] [-R [user][:.][group]] [--null]
       [--reset-access-time] [--make-directories] [--link]  [--quiet]  [--pre-
       serve-modification-time]    [--unconditional]    [--verbose]    [--dot]
       [--dereference]    [--owner=[user][:.][group]]    [--no-preserve-owner]
       [--sparse] [--help] [--version] destination-directory < name-list

Note that --sparse exists in both sections (the latter is a combination
of -o and -i modes).

To reproduce:

% mkdir foo bar
% find foo | cpio -o > archive
1 block
% cd bar
% cat ../archive | cpio --extract --sparse
cpio: --sparse is meaningless with --extract
% cat ../archive | cpio --extract 
1 block
% ls -sF
total 4
4 foo/

The --sparse argument should be honored as documented, and in any case
cpio should not refuse to unpack the archive.  cpio is a heavily-relied-
upon system management utility, so fixing this should be a high
priority.  Though I'm not checking off "security", it is a security risk
in the sense that there are now backup systems that will not work
(without alteration to an undesired state) to restore data.  This
particularly affects customers with large database and imaging
applications.

--jh--

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

-- 
cpio --extract says --sparse is meaningless
https://bugs.launchpad.net/bugs/134522
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

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

Reply via email to