postfix.patch 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. Index: makedefs
  2. --- makedefs.orig 2005-02-22 13:35:52 +0100
  3. +++ makedefs 2005-09-23 14:27:15 +0200
  4. @@ -116,6 +116,10 @@
  5. ;;
  6. FreeBSD.5*) SYSTYPE=FREEBSD5
  7. ;;
  8. + FreeBSD.6*) SYSTYPE=FREEBSD6
  9. + ;;
  10. + FreeBSD.7*) SYSTYPE=FREEBSD7
  11. + ;;
  12. OpenBSD.2*) SYSTYPE=OPENBSD2
  13. ;;
  14. OpenBSD.3*) SYSTYPE=OPENBSD3
  15. Index: src/util/file_limit.c
  16. --- src/util/file_limit.c.orig 2003-10-22 20:48:36 +0200
  17. +++ src/util/file_limit.c 2005-03-11 10:30:43 +0100
  18. @@ -80,12 +80,21 @@
  19. void set_file_limit(off_t limit)
  20. {
  21. #ifdef USE_ULIMIT
  22. +#ifdef USE_SOFTLIMITONLY
  23. +#error "USE_ULIMIT and USE_SOFTLIMITONLY are mutual exclusive"
  24. +#endif
  25. if (ulimit(UL_SETFSIZE, limit / ULIMIT_BLOCK_SIZE) < 0)
  26. msg_fatal("ulimit: %m");
  27. #else
  28. struct rlimit rlim;
  29. +#ifdef USE_SOFTLIMITONLY
  30. + if (getrlimit(RLIMIT_FSIZE, &rlim) < 0)
  31. + rlim.rlim_max = RLIM_INFINITY;
  32. + rlim.rlim_cur = limit;
  33. +#else
  34. rlim.rlim_cur = rlim.rlim_max = limit;
  35. +#endif
  36. if (setrlimit(RLIMIT_FSIZE, &rlim) < 0)
  37. msg_fatal("setrlimit: %m");
  38. #ifdef SIGXFSZ
  39. Index: src/util/msg_syslog.c
  40. --- src/util/msg_syslog.c.orig 2005-01-19 02:22:19 +0100
  41. +++ src/util/msg_syslog.c 2005-03-11 10:30:43 +0100
  42. @@ -50,6 +50,11 @@
  43. #include <syslog.h>
  44. #include <string.h>
  45. #include <time.h>
  46. +#ifdef USE_SOFTLIMITONLY
  47. +#include <sys/time.h>
  48. +#include <sys/resource.h>
  49. +#include <signal.h>
  50. +#endif
  51. /* Application-specific. */
  52. @@ -144,6 +149,9 @@
  53. static void msg_syslog_print(int level, const char *text)
  54. {
  55. +#ifdef USE_SOFTLIMITONLY
  56. + struct rlimit save, rlim;
  57. +#endif
  58. static int log_level[] = {
  59. LOG_INFO, LOG_WARNING, LOG_ERR, LOG_CRIT, LOG_CRIT,
  60. };
  61. @@ -154,6 +162,15 @@
  62. if (level < 0 || level >= (int) (sizeof(log_level) / sizeof(log_level[0])))
  63. msg_panic("msg_syslog_print: invalid severity level: %d", level);
  64. +#ifdef USE_SOFTLIMITONLY
  65. + if (getrlimit(RLIMIT_FSIZE, &save) < 0) {
  66. + save.rlim_cur = RLIM_INFINITY;
  67. + save.rlim_max = RLIM_INFINITY;
  68. + }
  69. + rlim.rlim_cur = save.rlim_max;
  70. + rlim.rlim_max = save.rlim_max;
  71. + (void)setrlimit(RLIMIT_FSIZE, &rlim);
  72. +#endif
  73. if (level == MSG_INFO) {
  74. syslog(syslog_facility | log_level[level], "%.*s",
  75. (int) MSG_SYSLOG_RECLEN, text);
  76. @@ -161,6 +178,9 @@
  77. syslog(syslog_facility | log_level[level], "%s: %.*s",
  78. severity_name[level], (int) MSG_SYSLOG_RECLEN, text);
  79. }
  80. +#ifdef USE_SOFTLIMITONLY
  81. + (void)setrlimit(RLIMIT_FSIZE, &save);
  82. +#endif
  83. }
  84. /* msg_syslog_init - initialize */
  85. Index: src/util/sys_defs.h
  86. --- src/util/sys_defs.h.orig 2005-02-04 01:07:44 +0100
  87. +++ src/util/sys_defs.h 2005-03-11 10:30:49 +0100
  88. @@ -24,7 +24,7 @@
  89. * 4.4BSD and close derivatives.
  90. */
  91. #if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4) \
  92. - || defined(FREEBSD5) || defined(FREEBSD6) \
  93. + || defined(FREEBSD5) || defined(FREEBSD6) || defined(FREEBSD7) \
  94. || defined(BSDI2) || defined(BSDI3) || defined(BSDI4) \
  95. || defined(OPENBSD2) || defined(OPENBSD3) \
  96. || defined(NETBSD1) || defined(NETBSD2) \