Article View: comp.sources.bugs
Article #339patch compress 4.2 (from c.s.r.)
From: Paul Bijnens
Date: Tue, 15 Sep 1992 11:54
Date: Tue, 15 Sep 1992 11:54
46 lines
2210 bytes
2210 bytes
The recently posted sources for compress 4.2 (on comp.sources.reviewed)
still contains the bug that I posted 2 times (and have seen mentioned
by other people a few other times). I wonder how it slipped through
the testing procedures... :-)
Nice to see compress still improved though.
The bug just boils down to the fact that in System V, you cannot
change the times of a file if you are not the owner. So just
move the "chown" syscall after the "utime" syscall.
Below is a uni-diff patch.
Sending this from an IBM mainframe running VM/CMS, the spaces, tabs
and line-endings will be grossly mangled... :-(
But wasn't the layout spoiled already by
the last "cleanup" (see compress42.c line 15)?
########################### cut here #################################
--- orig/compres42.c Mon Aug 31 23:58:04 1992
+++ compress42.c Sun Sep 13 09:10:40 1992
@@ -1213,9 +1213,6 @@
timep.actime = infstat.st_atime;
timep.modtime = infstat.st_mtime;
-#ifndef DOS
- chown(ofname, infstat.st_uid,
infstat.st_gid); /* Copy ownership */
-#endif
if (utime(ofname, &timep))
{
@@ -1223,6 +1220,9 @@
perror(ofname);
exit_code = 1;
}
+#ifndef DOS
+ chown(ofname, infstat.st_uid,
infstat.st_gid); /* Copy ownership */
+#endif
remove_ofname = 0;
########################### cut here #################################
--
Paul Bijnens
Linguistics dept., K. University Leuven, Belgium
Polleke@cc1.kuleuven.ac.be
Technical Details
Message-ID:
<92259.115436FFAAC09@cc1.kuleuven.ac.be>Path:
arc1-ca.pugleaf.net!sparky!uunet!news.univie.ac.at!blekul11!ffaac09Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!news.univie.ac.at!blekul11!ffaac09 Organization: K.U.Leuven - Academic Computing Center Date: Tuesday, 15 Sep 1992 11:54:36 +02 From: Paul Bijnens <FFAAC09@cc1.kuleuven.ac.be> Message-ID: <92259.115436FFAAC09@cc1.kuleuven.ac.be> Newsgroups: comp.sources.bugs Subject: patch compress 4.2 (from c.s.r.) Lines: 46