home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / sys5 / r4 / 1140 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  1.9 KB

  1. Xref: sparky comp.unix.sys5.r4:1140 comp.unix.sysv386:17674
  2. Path: sparky!uunet!mcsun!sun4nl!tuegate.tue.nl!svin09!wsinis07!debra
  3. From: debra@wsinis07.info.win.tue.nl (Paul De Bra)
  4. Newsgroups: comp.unix.sys5.r4,comp.unix.sysv386
  5. Subject: serious bug in cpio -i -Htar
  6. Summary: cpio overwrites files not asked for
  7. Message-ID: <4910@svin09.info.win.tue.nl>
  8. Date: 6 Jan 93 13:56:13 GMT
  9. Sender: news@svin09.info.win.tue.nl
  10. Reply-To: debra@info.win.tue.nl
  11. Followup-To: comp.unix.sys5.r4
  12. Organization: Eindhoven University of Technology, the Netherlands
  13. Lines: 37
  14.  
  15. I just found this unbelievable but dead serious bug in cpio.
  16. I verified the bug with Esix 4.0.4 and with DG/UX 5.4.1 (on an AViiON, with
  17. mc88100 cpu), so it seems like a fairly widespread bug in sVr4.
  18.  
  19. The bug is that when reading a tar archive (cpio can do that you know)
  20. cpio will restore all files with more than one link, even if they are
  21. not asked for.
  22.  
  23. Here is what you do to reproduce the bug:
  24. $ echo "aaa" > a
  25. $ echo "bbb" > b
  26. $ echo "ccc" > c
  27. $ ln a d
  28. $ tar cf e a b c d
  29. a d link to a             (this is a message from tar, produced by Esix 4.0.4
  30.                but not by DG/UX)
  31. $ rm d                    (not necessary, but supplies proof of bug)
  32. $ cpio -ivu -H tar -Ie b
  33. b
  34. a linked to d             (a is linked to d here even though we don't ask for
  35. d               either a or d)
  36. $ ls a b c d
  37. a  b  c  d                (yep, file d exists)
  38.  
  39. I discovered this bug while trying to restore a file from a tar tape using
  40. cpio (why not, cpio can read tar...) and in addition to the file i wanted
  41. cpio proceeded to trash (i.e. also restore) all files with more than one
  42. (hard) link.
  43.  
  44. Workaround: if you're not sure whether you have a tar or cpio archive,
  45. try to determine the format before extracting files. If the archive is
  46. a tar archive do *not* extract files using cpio but use tar instead.
  47.  
  48. Have others noticed this bug? Is it fixed in the latest sVr4 products?
  49.  
  50. Paul.
  51. (debra@win.tue.nl)
  52.