home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / bugs / 4bsd / 238 < prev    next >
Encoding:
Text File  |  1992-12-16  |  2.5 KB  |  58 lines

  1. Newsgroups: comp.bugs.4bsd
  2. Path: sparky!uunet!mcsun!Germany.EU.net!rzsun2.informatik.uni-hamburg.de!rzdspc24!zierke
  3. From: zierke@rzdspc24.informatik.uni-hamburg.de (Reinhard Zierke)
  4. Subject: Re: A serious bug in unix2dos/dos2unix
  5. Message-ID: <zierke.724493009@rzdspc24>
  6. Sender: news@informatik.uni-hamburg.de (Mr. News)
  7. Organization: University of Hamburg, FRG
  8. References: <1992Dec12.224109.15621@cs.mcgill.ca> <2527@ispi.COM>
  9. Distirbution: world
  10. Date: 16 Dec 92 08:03:29 GMT
  11. Lines: 45
  12.  
  13. jbayer@ispi.COM (Jonathan Bayer) writes:
  14.  
  15. > haiying@cs.mcgill.ca (Haiying ZHANG) writes:
  16. > >   I came across this bug a while ago. This has to do with using wild
  17. > >card in file names with unix2dos/dos2unix.
  18. > >   If you use a wild card in the file name, be it a single * or a ?
  19. > >embedded in a pattern, these two handy utilities will wipe out your
  20. > >entire current directory with the exception of the first file. It will
  21. > >set all the rest of the file to size 0. 
  22. > >   Although the man page does mention anything about wild card in
  23. > >filename making one believe that it is not supported, it should not in
  24. > >any case cause serious damaging to your files. While I am at it, these
  25. > >two programs look like a recompile of its DOS version. It should have
  26. > >provided more - options such as -Rfp etc. as in cp. 
  27. > First, what system are you running on?
  28.  
  29. A student of mine had the same problems on a SPARCstation with SunOS 4.1.2
  30.  
  31. >                                         second, what are you trying to do?
  32. > On a Sun system the dos2unix command is designed to operate on ONE file only,
  33. > sending the output to the second file specification.  The wild cards are
  34. > expanded by the shell, and all the program sees is a long list of filenames.
  35. > It appears that you may be using it improperly.
  36.  
  37. This explains what dos2unix does, but not WHY it has such strange behaviour.
  38. Using software improperly MUST NOT lead to such damaging results. Beware
  39. of such bad software engineering!
  40.  
  41. At least unix2dos/dos2unix has to check that it is invoked with exactly two
  42. arguments, first of which is the input filename and the second one the output
  43. filename, not a directory name.  Better still, unix2dos/dos2unix should behave
  44. similar to mv/cp and allow an arbitrary number of files when the last argument
  45. is a directory name.
  46.  
  47. Reinhard
  48.  
  49. -- 
  50. Reinhard Zierke                   Universitaet Hamburg, FB Informatik
  51. zierke@informatik.uni-hamburg.de  Vogt-Koelln-Strasse 30, D-2000 Hamburg 54
  52.                                   Tel.: (040) 54715-295   Fax: -206
  53.