Guest User

Untitled

a guest
Oct 15th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. diff -aur apache2/Makefile apache2.new/Makefile
  2. --- apache2/Makefile 2008-09-16 20:04:05.000000000 +0900
  3. +++ apache2/Makefile 2012-05-31 16:07:13.000000000 +0900
  4. @@ -1,6 +1,7 @@
  5.  
  6. APXS = apxs
  7. APACHECTL = apachectl
  8. +RM = rm
  9.  
  10. MODULE = mod_cidr_lookup
  11.  
  12. @@ -15,7 +16,7 @@
  13. $(APXS) -Wc,'$(MY_CFLAGS)' -c -i $(MODULE).c
  14.  
  15. clean:
  16. - $(RM) *.o *.lo *.slo *.la *~
  17. + $(RM) *.o *.lo *.slo *.la
  18. $(RM) -r .libs
  19.  
  20. start:
  21. diff -aur apache2/mod_cidr_lookup.c apache2.new/mod_cidr_lookup.c
  22. --- apache2/mod_cidr_lookup.c 2008-09-16 20:04:05.000000000 +0900
  23. +++ apache2/mod_cidr_lookup.c 2012-05-31 16:02:35.000000000 +0900
  24. @@ -29,6 +29,7 @@
  25. #include <sys/socket.h>
  26. #include <netinet/in.h>
  27. #include <arpa/inet.h>
  28. +#include <libgen.h>
  29.  
  30. #include "httpd.h"
  31. #include "http_config.h"
  32. @@ -194,9 +195,9 @@
  33. }
  34.  
  35. len = 32;
  36. - if (sscanf(line, "%s%d", ip, &len) < 1) {
  37. + if (sscanf(line, "%s%ld", ip, &len) < 1) {
  38. ap_log_perror(APLOG_MARK, APLOG_WARNING, errno, pool,
  39. - "read error: %s(%s/%d)\n", line, ip, len);
  40. + "read error: %s(%s/%ld)\n", line, ip, len);
  41. } else {
  42. if (!inet_aton(ip, (struct in_addr *)&ad)) {
  43. ap_log_perror(APLOG_MARK, APLOG_WARNING, errno, pool,
  44. @@ -424,11 +425,11 @@
  45. CIDR_TRIE *trie_root = ap_get_module_config(r->per_dir_config,
  46. &cidr_lookup_module);
  47.  
  48. - if (trie_root->name == NULL)
  49. - return DECLINED;
  50. -
  51. type = lookup_cidr(r, trie_root);
  52.  
  53. + if (type == NULL || strlen(type) < 1)
  54. + return DECLINED;
  55. +
  56. apr_table_setn(r->subprocess_env, "X_CLIENT_TYPE", type);
  57. apr_table_setn(r->headers_in, "X-Client-Type", type);
Add Comment
Please, Sign In to add comment