rsync.patch 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. Index: zlib/infcodes.c
  2. --- zlib/infcodes.c.orig 2002-03-12 02:14:58.000000000 +0100
  3. +++ zlib/infcodes.c 2004-04-29 17:21:36.000000000 +0200
  4. @@ -197,8 +197,18 @@
  5. c->mode = COPY;
  6. case COPY: /* o: copying bytes in window, waiting for space */
  7. f = q - c->sub.copy.dist;
  8. +#ifdef __FreeBSD__
  9. + {
  10. + /* Work-around for a FreeBSD gcc bug. */
  11. + volatile inflate_blocks_statef *s1 = s;
  12. +
  13. + while (f < s1->window) /* modulo window size-"while" instead */
  14. + f += s1->end - s1->window; /* of "if" handles invalid distances */
  15. + }
  16. +#else
  17. while (f < s->window) /* modulo window size-"while" instead */
  18. f += s->end - s->window; /* of "if" handles invalid distances */
  19. +#endif
  20. while (c->len)
  21. {
  22. NEEDOUT
  23. Index: flist.c
  24. --- flist.c.orig 2004-04-29 21:37:15.000000000 +0200
  25. +++ flist.c 2004-05-03 16:11:52.000000000 +0200
  26. @@ -539,6 +539,7 @@
  27. rdev_major = 0;
  28. uid = 0, gid = 0;
  29. *lastname = '\0';
  30. + lastdir_len = -1;
  31. return;
  32. }
  33. @@ -745,7 +746,7 @@
  34. char *basename, *dirname, *bp;
  35. unsigned short flags = 0;
  36. - if (!flist) /* lastdir isn't valid if flist is NULL */
  37. + if (!flist || !flist->count) /* lastdir isn't valid if flist is NULL */
  38. lastdir_len = -1;
  39. if (strlcpy(thisname, fname, sizeof thisname)
  40. =============================================================================
  41. Security Fix:
  42. There is a path-sanitizing bug that affects daemon mode in all recent
  43. rsync versions (including 2.6.2) but only if chroot is disabled. It
  44. does NOT affect the normal send/receive filenames that specify what
  45. files should be transferred (this is because these names happen to get
  46. sanitized twice, and thus the second call removes any lingering leading
  47. slash(es) that the first call left behind). It does affect certain
  48. option paths that cause auxilliary files to be read or written. One
  49. potential fix that doesn't require recompiling rsync is to set "use
  50. chroot = true" for all the modules in the rsyncd.conf file.
  51. Index: util.c
  52. --- util.c.orig 2004-04-27 21:59:37 +0200
  53. +++ util.c 2004-08-15 11:45:47 +0200
  54. @@ -743,7 +743,7 @@
  55. allowdotdot = 1;
  56. } else {
  57. p += 2;
  58. - if (*p == '/')
  59. + while (*p == '/')
  60. p++;
  61. if (sanp != start) {
  62. /* back up sanp one level */