mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.5 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/gzip/gzip-1.3.5-gzip-perm.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. --- gzip-1.3.5/gzip.c.perm 2005-04-26 14:22:58.211395152 +0200
  20. +++ gzip-1.3.5/gzip.c 2005-04-26 14:24:10.414418624 +0200
  21. @@ -881,6 +881,20 @@
  22. }
  23. close(ifd);
  24. + /* ofd ownership and permissions have to be set before close(ofd)*/
  25. + if (!to_stdout) {
  26. + if (fchmod(ofd, istat.st_mode & 07777)) {
  27. + int e = errno;
  28. + WARN((stderr, "%s: ", progname));
  29. + if (!quiet) {
  30. + errno = e;
  31. + perror(ofname);
  32. + }
  33. + }
  34. +#ifndef NO_CHOWN
  35. + fchown(ofd, istat.st_uid, istat.st_gid); /* Copy ownership */
  36. +#endif
  37. + }
  38. if (!to_stdout && close(ofd)) {
  39. write_error();
  40. }
  41. @@ -902,7 +916,7 @@
  42. }
  43. fprintf(stderr, "\n");
  44. }
  45. - /* Copy modes, times, ownership, and remove the input file */
  46. + /* Copy times and remove the input file */
  47. if (!to_stdout) {
  48. copy_stat(&istat);
  49. }
  50. @@ -1715,7 +1729,7 @@
  51. /* ========================================================================
  52. - * Copy modes, times, ownership from input file to output file.
  53. + * Copy times from input file to output file.
  54. * IN assertion: to_stdout is false.
  55. */
  56. local void copy_stat(ifstat)
  57. @@ -1730,18 +1744,6 @@
  58. }
  59. reset_times(ofname, ifstat);
  60. #endif
  61. - /* Copy the protection modes */
  62. - if (chmod(ofname, ifstat->st_mode & 07777)) {
  63. - int e = errno;
  64. - WARN((stderr, "%s: ", progname));
  65. - if (!quiet) {
  66. - errno = e;
  67. - perror(ofname);
  68. - }
  69. - }
  70. -#ifndef NO_CHOWN
  71. - chown(ofname, ifstat->st_uid, ifstat->st_gid); /* Copy ownership */
  72. -#endif
  73. remove_ofname = 0;
  74. /* It's now safe to remove the input file: */
  75. if (xunlink (ifname)) {