apachetop-0.12.6-maxpathlen.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. Patch by Robert Scheck <robert@fedoraproject.org> for apachetop <= 0.12.6, which
  2. adds some includes in order to have a real change to get MAXPATHLEN defined with
  3. a valid value. Once MAXPATHLEN really gets filled with 128, it will just cause a
  4. buffer overflow.
  5. See Red Hat Bugzilla #446199 (https://bugzilla.redhat.com/show_bug.cgi?id=446199)
  6. for more information. This patch should solve the mentioned bug report and should
  7. be sane enough to get included by upstream of apachetop for the next release. It
  8. is important to run autoheader before ./configure to get these changes activated.
  9. --- apachetop-0.12.6/configure.ac 2005-10-27 18:39:25.000000000 +0200
  10. +++ apachetop-0.12.6/configure.ac.maxpathlen 2008-06-21 16:00:38.000000000 +0200
  11. @@ -34,7 +34,8 @@
  12. # Checks for header files.
  13. AC_HEADER_STDC
  14. AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h \
  15. - string.h strings.h sys/socket.h time.h sys/time.h])
  16. + string.h strings.h sys/socket.h time.h sys/time.h \
  17. + limits.h sys/param.h])
  18. # Checks for typedefs, structures, and compiler characteristics.
  19. #AC_HEADER_STDBOOL # not in 2.53?
  20. --- apachetop-0.12.6/src/apachetop.h 2005-10-15 18:10:01.000000000 +0200
  21. +++ apachetop-0.12.6/src/apachetop.h.maxpatlen 2008-06-21 16:02:00.000000000 +0200
  22. @@ -89,8 +89,12 @@
  23. #define getMIN(a,b) (a < b ? a : b)
  24. #define getMAX(a,b) (a > b ? a : b)
  25. -#ifndef MAXPATHLEN
  26. -# define MAXPATHLEN 128
  27. +#ifdef HAVE_SYS_PARAM_H
  28. +# include <sys/param.h>
  29. +#endif
  30. +
  31. +#if HAVE_LIMITS_H
  32. +# include <limits.h>
  33. #endif
  34. /* upon startup, each input file is put into an element of this array,