From 7a05d009f429ef3161243c800c664de700aaf2cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Sun, 5 May 2013 22:39:28 +0200 Subject: [PATCH] - build with apache 2.4 - rel 9 --- apache-mod_watch-apache24.patch | 114 ++++++++++++++++++++++++++++++++ apache-mod_watch.spec | 6 +- 2 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 apache-mod_watch-apache24.patch diff --git a/apache-mod_watch-apache24.patch b/apache-mod_watch-apache24.patch new file mode 100644 index 0000000..93ee867 --- /dev/null +++ b/apache-mod_watch-apache24.patch @@ -0,0 +1,114 @@ +--- mod_watch-4.3/mod_watch.c.orig 2013-05-05 22:35:43.271485347 +0200 ++++ mod_watch-4.3/mod_watch.c 2013-05-05 22:36:50.621484860 +0200 +@@ -785,8 +785,8 @@ + struct watchConfDir *dconf; + + /* Do not count if the connection is excluded. */ +- if (ntIsMember(networkExcludeList, r->connection->remote_addr) +- && !ntIsMember(networkIncludeList, r->connection->remote_addr)) ++ if (ntIsMember(networkExcludeList, r->useragent_addr) ++ && !ntIsMember(networkIncludeList, r->useragent_addr)) + return DECLINED; + + if (watch_what & (WATCH_OWNER|WATCH_OWNER_BY_PORT)) { +@@ -820,12 +820,12 @@ + } + + if (watch_what & WATCH_REMOTE_IP) { +- key = apr_psprintf(r->pool, "ip/%s", r->connection->remote_ip); ++ key = apr_psprintf(r->pool, "ip/%s", r->connection->client_ip); + watchPostReadRequestHash(r, "watch-remote-ip", key); + } + + if (watch_what & WATCH_REMOTE_IP_BY_PORT) { +- key = apr_psprintf(r->pool, "ip/%s,%u", r->connection->remote_ip, ap_get_server_port(r)); ++ key = apr_psprintf(r->pool, "ip/%s,%u", r->connection->client_ip, ap_get_server_port(r)); + watchPostReadRequestHash(r, "watch-remote-ip-by-port", key); + } + +@@ -939,8 +939,8 @@ + } + + /* Do not count if the connection is excluded. */ +- if (ntIsMember(networkExcludeList, r->connection->remote_addr) +- && !ntIsMember(networkIncludeList, r->connection->remote_addr)) ++ if (ntIsMember(networkExcludeList, r->useragent_addr) ++ && !ntIsMember(networkIncludeList, r->useragent_addr)) + return DECLINED; + + #ifdef WATCH_OUTPUT_VERSION_3 +@@ -980,12 +980,12 @@ + } + + if (watch_what & WATCH_REMOTE_IP) { +- key = apr_psprintf(r->pool, "ip/%s", r->connection->remote_ip); ++ key = apr_psprintf(r->pool, "ip/%s", r->connection->client_ip); + watchLogHash(r, key, data); + } + + if (watch_what & WATCH_REMOTE_IP_BY_PORT) { +- key = apr_psprintf(r->pool, "ip/%s,%u", r->connection->remote_ip, ap_get_server_port(r)); ++ key = apr_psprintf(r->pool, "ip/%s,%u", r->connection->client_ip, ap_get_server_port(r)); + watchLogHash(r, key, data); + } + +@@ -1345,7 +1345,7 @@ + watchPreConfig(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp) + { + #if defined(WHEN_APACHE_EXPLAINS_WHAT_TO_DO) && defined(__unix__) +- unixd_pre_config(ptemp); ++ ap_unixd_pre_config(ptemp); + #endif + watchDocumentsList = apr_array_make(pconf, 0, sizeof *watchDocumentsDef); + networkIncludeList = apr_array_make(pconf, 0, sizeof (apr_ipsubnet_t *)); +@@ -1401,8 +1401,8 @@ + * child processes can R/W to it later when ever they need to flush + * or dump shared memory hash table entries to disk. + */ +- (void) chown(stateDirectory, unixd_config.user_id, unixd_config.group_id); +- (void) chown(stateDirectoryIp, unixd_config.user_id, unixd_config.group_id); ++ (void) chown(stateDirectory, ap_unixd_config.user_id, ap_unixd_config.group_id); ++ (void) chown(stateDirectoryIp, ap_unixd_config.user_id, ap_unixd_config.group_id); + #endif + + /* Create shared memory hash table. */ +@@ -1425,7 +1425,7 @@ + watchChildInit(apr_pool_t *p, server_rec *s) + { + #if defined(WHEN_APACHE_EXPLAINS_WHAT_TO_DO) && defined(__unix__) +- unixd_setup_child(); ++ ap_unixd_setup_child(); + #endif + shChildInit(shtable, p); + } +--- mod_watch-4.3/SharedHash.c~ 2013-05-05 22:38:31.131484131 +0200 ++++ mod_watch-4.3/SharedHash.c 2013-05-05 22:38:59.641483926 +0200 +@@ -159,7 +159,7 @@ + (void) fprintf(fp, "\n"); + fclose(fp); + #if defined(__unix__) +- (void) chown(tp->pathname, unixd_config.user_id, unixd_config.group_id); ++ (void) chown(tp->pathname, ap_unixd_config.user_id, ap_unixd_config.group_id); + #endif + } + } +@@ -485,8 +485,8 @@ + goto error1; + } + +- shmbuf.shm_perm.uid = unixd_config.user_id; +- shmbuf.shm_perm.gid = unixd_config.group_id; ++ shmbuf.shm_perm.uid = ap_unixd_config.user_id; ++ shmbuf.shm_perm.gid = ap_unixd_config.group_id; + shmbuf.shm_perm.mode = 0600; + + if (shmctl(theMem->shmid, IPC_SET, &shmbuf) != 0) { +@@ -524,7 +524,7 @@ + } + + #if defined(__unix__) +- unixd_set_global_mutex_perms((apr_global_mutex_t *) tp->mutex); ++ ap_unixd_set_global_mutex_perms((apr_global_mutex_t *) tp->mutex); + #endif + + tp->info = (struct shInfo *) MemoryAllocate(tp->memory, sizeof *tp->info); diff --git a/apache-mod_watch.spec b/apache-mod_watch.spec index 601a2b6..83678fc 100644 --- a/apache-mod_watch.spec +++ b/apache-mod_watch.spec @@ -1,13 +1,13 @@ # TODO # - package -DSTATEDIR=/var/lib/mod_watch ? %define mod_name watch -%define apxs /usr/sbin/apxs +%define apxs /usr/sbin/apxs %include /usr/lib/rpm/macros.perl Summary: Apache module: Monitoring Interface for MRTG Summary(pl.UTF-8): Moduł do apache: Interfejs do monitorowania za pomocą MRTG Name: apache-mod_%{mod_name} Version: 4.03 -Release: 8 +Release: 9 License: BSD Group: Networking/Daemons/HTTP Source0: http://www.snert.com/Software/download/mod_watch%(echo %{version} | tr -d .).tgz @@ -16,6 +16,7 @@ Source1: %{name}.conf Patch0: %{name}-apr-fix.patch Patch1: %{name}-shm-fix.patch Patch2: %{name}-mutex.patch +Patch3: %{name}-apache24.patch URL: http://www.snert.com/Software/mod_watch/ BuildRequires: %{apxs} BuildRequires: apache-devel >= 2.0.52-2 @@ -49,6 +50,7 @@ wspiera mod_vhost_alias oraz mod_gzip. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build %{__make} -f Makefile.dso build \ -- 2.44.0