home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sources / bugs / 234 < prev    next >
Encoding:
Internet Message Format  |  1992-09-15  |  2.1 KB

  1. Path: sparky!uunet!news.univie.ac.at!blekul11!ffaac09
  2. Organization: K.U.Leuven - Academic Computing Center
  3. Date: Tuesday, 15 Sep 1992 11:54:36 +02
  4. From: Paul Bijnens <FFAAC09@cc1.kuleuven.ac.be>
  5. Message-ID: <92259.115436FFAAC09@cc1.kuleuven.ac.be>
  6. Newsgroups: comp.sources.bugs
  7. Subject:    patch compress 4.2 (from c.s.r.)
  8. Lines: 46
  9.  
  10. The recently posted sources for compress 4.2 (on comp.sources.reviewed)
  11. still contains the bug that I posted 2 times (and have seen mentioned
  12. by other people a few other times).  I wonder how it slipped through
  13. the testing procedures... :-)
  14. Nice to see compress still improved though.
  15.  
  16. The bug just boils down to the fact that in System V, you cannot
  17. change the times of a file if you are not the owner.  So just
  18. move the "chown" syscall after the "utime" syscall.
  19. Below is a uni-diff patch.
  20.  
  21. Sending this from an IBM mainframe running VM/CMS, the spaces, tabs
  22. and line-endings will be grossly mangled... :-(
  23. But wasn't the layout spoiled already by
  24. the last "cleanup" (see compress42.c line 15)?
  25.  
  26. ########################### cut here #################################
  27. --- orig/compres42.c    Mon Aug 31 23:58:04 1992
  28. +++ compress42.c   Sun Sep 13 09:10:40 1992
  29. @@ -1213,9 +1213,6 @@
  30.  
  31.                                         timep.actime = infstat.st_atime;
  32.                                         timep.modtime = infstat.st_mtime;
  33. -#ifndef        DOS
  34. -                                       chown(ofname, infstat.st_uid,
  35. infstat.st_gid); /* Copy ownership */
  36. -#endif
  37.  
  38.                                         if (utime(ofname, &timep))
  39.                                         {
  40. @@ -1223,6 +1220,9 @@
  41.                                         perror(ofname);
  42.                                                 exit_code = 1;
  43.                                         }
  44. +#ifndef        DOS
  45. +                                       chown(ofname, infstat.st_uid,
  46. infstat.st_gid); /* Copy ownership */
  47. +#endif
  48.  
  49.                                         remove_ofname = 0;
  50.  
  51. ########################### cut here #################################
  52. --
  53. Paul Bijnens
  54. Linguistics dept., K. University Leuven, Belgium
  55. Polleke@cc1.kuleuven.ac.be
  56.