Fix for new httpd module ABI.
This commit is contained in:
parent
6adf320c13
commit
94ac954329
@ -1,9 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.22 2007/09/15 20:38:22 merdely Exp $
|
||||
# $OpenBSD: Makefile,v 1.23 2008/05/09 08:24:31 mbalmer Exp $
|
||||
|
||||
COMMENT= module that embeds a Perl interpreter into Apache
|
||||
|
||||
DISTNAME= mod_perl-1.30
|
||||
PKGNAME= ${DISTNAME}p1
|
||||
PKGNAME= ${DISTNAME}p2
|
||||
CATEGORIES= www perl5
|
||||
MASTER_SITES= http://perl.apache.org/dist/ \
|
||||
${MASTER_SITE_PERL_CPAN:=Apache/}
|
||||
|
54
www/mod_perl/patches/patch-src_modules_perl_Connection_xs
Normal file
54
www/mod_perl/patches/patch-src_modules_perl_Connection_xs
Normal file
@ -0,0 +1,54 @@
|
||||
$OpenBSD: patch-src_modules_perl_Connection_xs,v 1.1 2008/05/09 08:24:31 mbalmer Exp $
|
||||
--- src/modules/perl/Connection.xs.orig Fri Mar 30 07:12:42 2007
|
||||
+++ src/modules/perl/Connection.xs Wed Dec 5 17:41:08 2007
|
||||
@@ -23,8 +23,8 @@ BOOT:
|
||||
|
||||
# /* Who is the client? */
|
||||
|
||||
-# struct sockaddr_in local_addr; /* local address */
|
||||
-# struct sockaddr_in remote_addr;/* remote address */
|
||||
+# struct sockaddr_storage local_addr; /* local address */
|
||||
+# struct sockaddr_storage remote_addr;/* remote address */
|
||||
# char *remote_ip; /* Client's IP address */
|
||||
# char *remote_host; /* Client's DNS name, if known.
|
||||
# * NULL if DNS hasn't been checked,
|
||||
@@ -78,7 +78,7 @@ remote_addr(conn, sv_addr=Nullsv)
|
||||
RETVAL = newSVpv((char *)&conn->remote_addr,
|
||||
sizeof conn->remote_addr);
|
||||
if(sv_addr) {
|
||||
- struct sockaddr_in addr;
|
||||
+ struct sockaddr_storage addr;
|
||||
STRLEN sockaddrlen;
|
||||
char * new_addr = SvPV(sv_addr,sockaddrlen);
|
||||
if (sockaddrlen != sizeof(addr)) {
|
||||
@@ -97,7 +97,9 @@ remote_ip(conn, ...)
|
||||
|
||||
CODE:
|
||||
RETVAL = conn->remote_ip;
|
||||
-
|
||||
+
|
||||
+ struct addrinfo hints, *res, *res0;
|
||||
+ int error;
|
||||
if(items > 1) {
|
||||
#ifdef SGI_BOOST
|
||||
ap_cpystrn(conn->remote_ip, (char *)SvPV(ST(1),na),
|
||||
@@ -106,7 +108,18 @@ remote_ip(conn, ...)
|
||||
#else
|
||||
conn->remote_ip = pstrdup(conn->pool, (char *)SvPV(ST(1),na));
|
||||
#endif
|
||||
- conn->remote_addr.sin_addr.s_addr = inet_addr(conn->remote_ip);
|
||||
+ memset(&hints, 0, sizeof(hints));
|
||||
+ hints.ai_family = PF_UNSPEC;
|
||||
+ hints.ai_socktype = SOCK_STREAM;
|
||||
+ error = getaddrinfo(conn->remote_ip, NULL, &hints, &res0);
|
||||
+ if (!error) {
|
||||
+ memcpy(&conn->remote_addr, (const void *)res0->ai_addr,
|
||||
+ (size_t) res0->ai_addrlen);
|
||||
+ freeaddrinfo(res0);
|
||||
+ } else {
|
||||
+ croak("Bad IP address in remote_ip getaddrinfo failed %s",
|
||||
+ gai_strerror(error));
|
||||
+ }
|
||||
}
|
||||
|
||||
OUTPUT:
|
@ -1,9 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2007/07/25 20:05:04 simon Exp $
|
||||
# $OpenBSD: Makefile,v 1.2 2008/05/09 08:26:53 mbalmer Exp $
|
||||
|
||||
COMMENT= apache interface for SCGI servers
|
||||
|
||||
DISTNAME= scgi-1.12
|
||||
PKGNAME= mod_${DISTNAME}
|
||||
PKGNAME= mod_${DISTNAME}p0
|
||||
CATEGORIES= www
|
||||
|
||||
HOMEPAGE= http://python.ca/scgi/
|
||||
|
38
www/mod_scgi/patches/patch-apache1_mod_scgi_c
Normal file
38
www/mod_scgi/patches/patch-apache1_mod_scgi_c
Normal file
@ -0,0 +1,38 @@
|
||||
$OpenBSD: patch-apache1_mod_scgi_c,v 1.1 2008/05/09 08:26:53 mbalmer Exp $
|
||||
--- apache1/mod_scgi.c.orig Wed Dec 5 12:19:31 2007
|
||||
+++ apache1/mod_scgi.c Wed Dec 5 12:23:12 2007
|
||||
@@ -266,13 +266,23 @@ static int send_headers(request_rec *r, BUFF *f)
|
||||
table *t;
|
||||
array_header *hdrs_arr, *env_arr;
|
||||
table_entry *hdrs, *env;
|
||||
- int i;
|
||||
+ char sbuf[NI_MAXSERV];
|
||||
+ u_int16_t port;
|
||||
+ int error, i;
|
||||
unsigned long n;
|
||||
|
||||
log_debug(r, "sending headers");
|
||||
t = ap_make_table(r->pool, 40); /* headers to send */
|
||||
if (!t)
|
||||
return 0;
|
||||
+
|
||||
+ error = getnameinfo((struct sockaddr *)&r->connection->remote_addr,
|
||||
+ r->connection->remote_addr.ss_len, NULL, 0, sbuf, sizeof(sbuf),
|
||||
+ NI_NUMERICSERV);
|
||||
+ if (!error)
|
||||
+ port = atol(sbuf);
|
||||
+ else
|
||||
+ port = 0;
|
||||
/* CONTENT_LENGTH must come first and always be present */
|
||||
add_header(t, "CONTENT_LENGTH",
|
||||
ap_psprintf(r->pool, "%ld", r->remaining));
|
||||
@@ -286,8 +296,7 @@ static int send_headers(request_rec *r, BUFF *f)
|
||||
ap_psprintf(r->pool, "%u", ap_get_server_port(r)));
|
||||
add_header(t, "REMOTE_ADDR", r->connection->remote_ip);
|
||||
add_header(t, "REMOTE_PORT",
|
||||
- ap_psprintf(r->pool, "%d",
|
||||
- ntohs(r->connection->remote_addr.sin_port)));
|
||||
+ ap_psprintf(r->pool, "%d", port));
|
||||
add_header(t, "REMOTE_USER", r->connection->user);
|
||||
add_header(t, "REQUEST_METHOD", r->method);
|
||||
add_header(t, "REQUEST_URI", original_uri(r));
|
@ -1,10 +1,10 @@
|
||||
# $OpenBSD: Makefile,v 1.17 2007/09/15 20:38:22 merdely Exp $
|
||||
# $OpenBSD: Makefile,v 1.18 2008/05/09 08:28:34 mbalmer Exp $
|
||||
|
||||
COMMENT= Web intrusion detection and prevention engine
|
||||
|
||||
VER= 1.9.3
|
||||
DISTNAME= modsecurity-apache_${VER}
|
||||
PKGNAME= modsecurity-apache-${VER}p1
|
||||
PKGNAME= modsecurity-apache-${VER}p2
|
||||
|
||||
CATEGORIES= www
|
||||
|
||||
|
41
www/mod_security/patches/patch-apache1_mod_security_c
Normal file
41
www/mod_security/patches/patch-apache1_mod_security_c
Normal file
@ -0,0 +1,41 @@
|
||||
$OpenBSD: patch-apache1_mod_security_c,v 1.1 2008/05/09 08:28:34 mbalmer Exp $
|
||||
--- apache1/mod_security.c.orig Wed Dec 5 12:04:19 2007
|
||||
+++ apache1/mod_security.c Wed Dec 5 12:14:37 2007
|
||||
@@ -6121,7 +6121,9 @@ void sec_auditlog_init(modsec_rec *msr) {
|
||||
char *uniqueid, *entry_filename, *entry_basename, *text;
|
||||
const array_header *arr = NULL;
|
||||
table_entry *te = NULL;
|
||||
- int i;
|
||||
+ char sbuf[NI_MAXSERV];
|
||||
+ u_int16_t localport, remoteport;
|
||||
+ int error, i;
|
||||
|
||||
sec_debug_log(r, 4, "sec_auditlog_init: Starting");
|
||||
|
||||
@@ -6189,9 +6191,24 @@ void sec_auditlog_init(modsec_rec *msr) {
|
||||
|
||||
/* Format: time transaction_id remote_addr remote_port local_addr local_port */
|
||||
|
||||
+ error = getnameinfo((struct sockaddr *)&r->connection->remote_addr,
|
||||
+ r->connection->remote_addr.ss_len, NULL, 0, sbuf, sizeof(sbuf),
|
||||
+ NI_NUMERICSERV);
|
||||
+ if (error)
|
||||
+ remoteport = 0;
|
||||
+ else
|
||||
+ remoteport = atol(sbuf);
|
||||
+ error = getnameinfo((struct sockaddr *)&r->connection->local_addr,
|
||||
+ r->connection->local_addr.ss_len, NULL, 0, sbuf, sizeof(sbuf),
|
||||
+ NI_NUMERICSERV);
|
||||
+ if (error)
|
||||
+ localport = 0;
|
||||
+ else
|
||||
+ localport = atol(sbuf);
|
||||
+
|
||||
text = ap_psprintf(r->pool, "[%s] %s %s %i %s %i",
|
||||
- current_logtime(r), uniqueid, r->connection->remote_ip, r->connection->remote_addr.sin_port,
|
||||
- r->connection->local_ip, r->connection->local_addr.sin_port);
|
||||
+ current_logtime(r), uniqueid, r->connection->remote_ip, remoteport,
|
||||
+ r->connection->local_ip, localport);
|
||||
sec_auditlog_write(msr, text, strlen(text));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user