Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -aur apache2/Makefile apache2.new/Makefile
- --- apache2/Makefile 2008-09-16 20:04:05.000000000 +0900
- +++ apache2/Makefile 2012-05-31 16:07:13.000000000 +0900
- @@ -1,6 +1,7 @@
- APXS = apxs
- APACHECTL = apachectl
- +RM = rm
- MODULE = mod_cidr_lookup
- @@ -15,7 +16,7 @@
- $(APXS) -Wc,'$(MY_CFLAGS)' -c -i $(MODULE).c
- clean:
- - $(RM) *.o *.lo *.slo *.la *~
- + $(RM) *.o *.lo *.slo *.la
- $(RM) -r .libs
- start:
- diff -aur apache2/mod_cidr_lookup.c apache2.new/mod_cidr_lookup.c
- --- apache2/mod_cidr_lookup.c 2008-09-16 20:04:05.000000000 +0900
- +++ apache2/mod_cidr_lookup.c 2012-05-31 16:02:35.000000000 +0900
- @@ -29,6 +29,7 @@
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- +#include <libgen.h>
- #include "httpd.h"
- #include "http_config.h"
- @@ -194,9 +195,9 @@
- }
- len = 32;
- - if (sscanf(line, "%s%d", ip, &len) < 1) {
- + if (sscanf(line, "%s%ld", ip, &len) < 1) {
- ap_log_perror(APLOG_MARK, APLOG_WARNING, errno, pool,
- - "read error: %s(%s/%d)\n", line, ip, len);
- + "read error: %s(%s/%ld)\n", line, ip, len);
- } else {
- if (!inet_aton(ip, (struct in_addr *)&ad)) {
- ap_log_perror(APLOG_MARK, APLOG_WARNING, errno, pool,
- @@ -424,11 +425,11 @@
- CIDR_TRIE *trie_root = ap_get_module_config(r->per_dir_config,
- &cidr_lookup_module);
- - if (trie_root->name == NULL)
- - return DECLINED;
- -
- type = lookup_cidr(r, trie_root);
- + if (type == NULL || strlen(type) < 1)
- + return DECLINED;
- +
- apr_table_setn(r->subprocess_env, "X_CLIENT_TYPE", type);
- apr_table_setn(r->headers_in, "X-Client-Type", type);
Add Comment
Please, Sign In to add comment