home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.sys5.r4:1140 comp.unix.sysv386:17674
- Path: sparky!uunet!mcsun!sun4nl!tuegate.tue.nl!svin09!wsinis07!debra
- From: debra@wsinis07.info.win.tue.nl (Paul De Bra)
- Newsgroups: comp.unix.sys5.r4,comp.unix.sysv386
- Subject: serious bug in cpio -i -Htar
- Summary: cpio overwrites files not asked for
- Message-ID: <4910@svin09.info.win.tue.nl>
- Date: 6 Jan 93 13:56:13 GMT
- Sender: news@svin09.info.win.tue.nl
- Reply-To: debra@info.win.tue.nl
- Followup-To: comp.unix.sys5.r4
- Organization: Eindhoven University of Technology, the Netherlands
- Lines: 37
-
- I just found this unbelievable but dead serious bug in cpio.
- I verified the bug with Esix 4.0.4 and with DG/UX 5.4.1 (on an AViiON, with
- mc88100 cpu), so it seems like a fairly widespread bug in sVr4.
-
- The bug is that when reading a tar archive (cpio can do that you know)
- cpio will restore all files with more than one link, even if they are
- not asked for.
-
- Here is what you do to reproduce the bug:
- $ echo "aaa" > a
- $ echo "bbb" > b
- $ echo "ccc" > c
- $ ln a d
- $ tar cf e a b c d
- a d link to a (this is a message from tar, produced by Esix 4.0.4
- but not by DG/UX)
- $ rm d (not necessary, but supplies proof of bug)
- $ cpio -ivu -H tar -Ie b
- b
- a linked to d (a is linked to d here even though we don't ask for
- d either a or d)
- $ ls a b c d
- a b c d (yep, file d exists)
-
- I discovered this bug while trying to restore a file from a tar tape using
- cpio (why not, cpio can read tar...) and in addition to the file i wanted
- cpio proceeded to trash (i.e. also restore) all files with more than one
- (hard) link.
-
- Workaround: if you're not sure whether you have a tar or cpio archive,
- try to determine the format before extracting files. If the archive is
- a tar archive do *not* extract files using cpio but use tar instead.
-
- Have others noticed this bug? Is it fixed in the latest sVr4 products?
-
- Paul.
- (debra@win.tue.nl)
-