debian/0000755000000000000000000000000011701735726007177 5ustar debian/patches/0000755000000000000000000000000011701735050010614 5ustar debian/patches/manpage0000644000000000000000000000112711701735050012150 0ustar Author: Ralf Treinen Description: Fix missing macro invocation in manpage Index: apachetop-0.12.6/man/apachetop.1 =================================================================== --- apachetop-0.12.6.orig/man/apachetop.1 2011-04-27 22:12:06.000000000 +0200 +++ apachetop-0.12.6/man/apachetop.1 2011-04-27 22:12:22.000000000 +0200 @@ -6,7 +6,7 @@ .SH DESCRIPTION ApacheTop watches a logfile generated by Apache (in standard common or combined logformat, and generates human-parsable output in realtime. -.OPTIONS +.SH OPTIONS .TP -f logfile Select which file to watch. debian/patches/series0000644000000000000000000000006411701735050012031 0ustar 01-conglomeration.patch 02-maxpathlen.patch manpage debian/patches/01-conglomeration.patch0000644000000000000000000001373411701735050015103 0ustar Author: n/a Description: Needs to be broken out (FIXME). diff -Naurp apachetop.orig/man/apachetop.1 apachetop/man/apachetop.1 --- apachetop.orig/man/apachetop.1 2009-07-16 21:43:27.000000000 +0000 +++ apachetop/man/apachetop.1 2009-07-16 21:46:39.000000000 +0000 @@ -51,4 +51,4 @@ apachetop -f /var/logs/httpd/access.log .SH AUTHOR Chris Elsworth .SH SEE ALSO -http://clueful.shagged.org/apachetop/ +http://www.webta.org/projects/apachetop/ diff -Naurp apachetop.orig/src/apachetop.cc apachetop/src/apachetop.cc --- apachetop.orig/src/apachetop.cc 2009-07-16 21:43:27.000000000 +0000 +++ apachetop/src/apachetop.cc 2009-07-16 21:46:39.000000000 +0000 @@ -208,8 +208,14 @@ int main(int argc, char *argv[]) /* if no files have been specified, we'll use DEFAULT_LOGFILE */ if (cf.input_count == 0) { - if (new_file(DEFAULT_LOGFILE, SEEK_TO_END) != -1) + if (new_file("/var/log/apache2/access.log", SEEK_TO_END) != -1) cf.input_count++; + else + { + if (new_file("/var/log/apache/access.log", SEEK_TO_END) != -1) + cf.input_count++; + } + /* if it's still zero, fail */ if (cf.input_count == 0) @@ -1007,7 +1013,11 @@ int new_file(char *filename, bool do_see if (do_seek_to_end) lseek(fd, 0, SEEK_END); - if (this_file->filename) free(this_file->filename); + /* + * skx: This causes crashes since the realloc above doesn't + * NULL set the memory. + * if (this_file->filename) free(this_file->filename); + */ this_file->inode = sb.st_ino; this_file->filename = strdup(realfile); diff -Naurp apachetop.orig/src/apachetop.h apachetop/src/apachetop.h --- apachetop.orig/src/apachetop.h 2009-07-16 21:43:27.000000000 +0000 +++ apachetop/src/apachetop.h 2009-07-16 21:46:39.000000000 +0000 @@ -5,6 +5,11 @@ # include "config.h" #endif +#undef _FILE_OFFSET_BITS +#undef _LARGE_FILES +#define _FILE_OFFSET_BITS 64 +#define _LARGE_FILES 1 + #include #include #include @@ -248,7 +253,7 @@ struct gstat { /* this can be overridden from config.h via ./configure --with-logfile .. */ #ifndef DEFAULT_LOGFILE -# define DEFAULT_LOGFILE "/var/httpd/apache_log" +# define DEFAULT_LOGFILE "/var/log/apache2/access.log" #endif #define DEFAULT_CIRCLE_SIZE 30 #define DEFAULT_CIRCLE_MODE TIMED_CIRCLE diff -Naurp apachetop.orig/src/hits_circle.cc apachetop/src/hits_circle.cc --- apachetop.orig/src/hits_circle.cc 2009-07-16 21:43:27.000000000 +0000 +++ apachetop/src/hits_circle.cc 2009-07-16 21:46:39.000000000 +0000 @@ -8,7 +8,7 @@ #include "apachetop.h" -extern map *hm, *um, *rm; +extern map *hm, *um, *rm, *im; int Hits_Circle::create(unsigned int passed_size) { @@ -48,7 +48,7 @@ int Hits_Circle::insert(struct logbits l hm->sub_ref(posptr->host_pos); um->sub_ref(posptr->url_pos); rm->sub_ref(posptr->ref_pos); - + im->sub_ref(posptr->ip_pos); } /* maintain some stats */ diff -Naurp apachetop.orig/src/log.cc apachetop/src/log.cc --- apachetop.orig/src/log.cc 2009-07-16 21:43:27.000000000 +0000 +++ apachetop/src/log.cc 2009-07-16 21:46:39.000000000 +0000 @@ -365,7 +365,8 @@ void collect_dns_responses() lb->want_host = false; lb->want_ip = false; delete lb->dns_query; - + lb->dns_query = NULL; + if (answer->status == adns_s_ok) { /* we have a reply */ diff -Naurp apachetop.orig/src/map.cc apachetop/src/map.cc --- apachetop.orig/src/map.cc 2009-07-16 21:43:27.000000000 +0000 +++ apachetop/src/map.cc 2009-07-16 21:46:39.000000000 +0000 @@ -41,7 +41,6 @@ int map::destroy(void) { free(tab); - tab_hash->destroy(); delete tab_hash; return 0; @@ -99,7 +98,7 @@ int map::insert(char *string) * particular entry is incremented */ tab[x].refcount++; -// dprintf("%d Found %p %d for %s\n", time(NULL), this, x, string); +// dprintf("%d Found %p %d %d for %s\n", time(NULL), this, x, tab[x].refcount, string); return x; } @@ -188,10 +187,22 @@ char *map::reverse(int pos) void map::sub_ref(int pos) { -// dprintf("%d subref %p %d for %s\n", -// time(NULL), this, pos, tab[pos].string); +// dprintf("%d subref %p %d %d for %s\n", +// time(NULL), this, pos, tab[pos].refcount, tab[pos].string); + + /* -1 means no/invalid position, can happen with ip map */ + if (pos < 0) return; - if (tab[pos].refcount > 0) + if (tab[pos].refcount > 0) { tab[pos].refcount--; - + if ((tab[pos].refcount == 0) && (tab[pos].string)) { + /* remove from hash */ + tab_hash->remove(tab[pos].string); + + /* remove from table */ + free(tab[pos].string); + tab[pos].string = NULL; + tab[pos].time = 0; + } + } } diff -Naurp apachetop.orig/src/resolver.h apachetop/src/resolver.h --- apachetop.orig/src/resolver.h 2009-07-16 21:43:27.000000000 +0000 +++ apachetop/src/resolver.h 2009-07-16 21:46:39.000000000 +0000 @@ -10,8 +10,8 @@ enum resolver_action class Resolver { public: - Resolver::Resolver(void); - Resolver::~Resolver(void); + Resolver(void); + ~Resolver(void); int add_request(char *request, enum resolver_action act); diff -Naurp apachetop.orig/src/timed_circle.cc apachetop/src/timed_circle.cc --- apachetop.orig/src/timed_circle.cc 2009-07-16 21:43:27.000000000 +0000 +++ apachetop/src/timed_circle.cc 2009-07-16 21:46:39.000000000 +0000 @@ -15,7 +15,7 @@ extern time_t now; /* global ApacheTop-wide to save on time() calls */ extern struct gstat gstats; -extern map *hm, *um, *rm; +extern map *hm, *um, *rm, *im; int Timed_Circle::create(unsigned int size) { @@ -92,6 +92,7 @@ void Timed_Circle::resetbucketstats(cons if (hit->host_pos) hm->sub_ref(hit->host_pos); if (hit->url_pos) um->sub_ref(hit->url_pos); if (hit->ref_pos) rm->sub_ref(hit->ref_pos); + if (hit->ip_pos) im->sub_ref(hit->ip_pos); } /* start at the beginning of the HIT array */ @@ -144,6 +145,7 @@ int Timed_Circle::insert(struct logbits if (hit->host_pos) hm->sub_ref(hit->host_pos); if (hit->url_pos) um->sub_ref(hit->url_pos); if (hit->ref_pos) rm->sub_ref(hit->ref_pos); + if (hit->ip_pos) im->sub_ref(hit->ip_pos); /* store the data itself */ memcpy(hit, &lb, sizeof(lb)); debian/patches/02-maxpathlen.patch0000644000000000000000000000271011701735050014215 0ustar Description: Add some includes in order to have a real change to get MAXPATHLEN defined with a valid value. Once MAXPATHLEN really gets filled with 128, it will just cause a buffer overflow. Author: Robert Scheck Origin: vendor, https://bugzilla.redhat.com/attachment.cgi?id=309968 Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=446199 Bug-Ubuntu: https://bugs.launchpad.net/bugs/294599 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514575 --- apachetop-0.12.6/configure.ac 2005-10-27 18:39:25.000000000 +0200 +++ apachetop-0.12.6/configure.ac.maxpathlen 2008-06-21 16:00:38.000000000 +0200 @@ -34,7 +34,8 @@ # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h \ - string.h strings.h sys/socket.h time.h sys/time.h]) + string.h strings.h sys/socket.h time.h sys/time.h \ + limits.h sys/param.h]) # Checks for typedefs, structures, and compiler characteristics. #AC_HEADER_STDBOOL # not in 2.53? --- apachetop-0.12.6/src/apachetop.h 2005-10-15 18:10:01.000000000 +0200 +++ apachetop-0.12.6/src/apachetop.h.maxpatlen 2008-06-21 16:02:00.000000000 +0200 @@ -89,8 +89,12 @@ #define getMIN(a,b) (a < b ? a : b) #define getMAX(a,b) (a > b ? a : b) -#ifndef MAXPATHLEN -# define MAXPATHLEN 128 +#ifdef HAVE_SYS_PARAM_H +# include +#endif + +#if HAVE_LIMITS_H +# include #endif /* upon startup, each input file is put into an element of this array, debian/compat0000644000000000000000000000000211701735050010363 0ustar 7 debian/apachetop.docs0000644000000000000000000000003111701735050011775 0ustar AUTHORS NEWS README TODO debian/control0000644000000000000000000000151711701735050010574 0ustar Source: apachetop Section: admin Priority: optional Maintainer: Debian QA Group Build-Depends: debhelper (>= 7.0.50~), autotools-dev, libadns1-dev, libgamin-dev, libncurses5-dev, libpcre3-dev, libreadline-dev, dh-autoreconf Standards-Version: 3.8.2 Homepage: http://www.webta.org/projects/apachetop/ Package: apachetop Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends}, gamin Description: Realtime Apache monitoring tool Apache top is a curses-based realtime utility to display information from a running copy of Apache. . It is modelled after the standard 'top' utility, and displays information such as the requests pers second, bytes per second and the most popular URLs displayed. . It must be run from a machine running Apache, as it works by processing the logfiles found in /var/log/apache. debian/changelog0000644000000000000000000002105011701735050011035 0ustar apachetop (0.12.6-16) unstable; urgency=low * QA upload. * Add Debian bug number to 02-maxpathlen.patch -- Chow Loong Jin Sat, 07 Jan 2012 11:19:35 +0800 apachetop (0.12.6-15) unstable; urgency=low * QA upload. * Import changes from Ubuntu: - Use autoreconf. Thanks to Felix Geyer - Import 02-maxpathlen.patch. Thanks to Nicolas Van Wambeke (Closes: #514575) * Drop autotools bits from 01-conglomeration.patch -- Chow Loong Jin Sat, 07 Jan 2012 10:51:02 +0800 apachetop (0.12.6-14) unstable; urgency=low * QA upload. * Drop autmake1.7 from Build-Depends since it is not used. -- Paul Wise Sun, 16 Oct 2011 11:18:10 +0800 apachetop (0.12.6-13) unstable; urgency=low * QA upload * Replace build-dependency on libreadline5-dev by libreadline-dev (closes: #553724) * Bump version in build-dependency of debhelper (needed for overrides) * source format 3.0 (quilt) * patch manpage: fix missing macro invocation in manpage. -- Ralf Treinen Wed, 27 Apr 2011 22:15:11 +0200 apachetop (0.12.6-12) unstable; urgency=low * Removing vcs fields. * Orphaning package. -- Daniel Baumann Sun, 09 Aug 2009 01:27:00 +0200 apachetop (0.12.6-11) unstable; urgency=low * Wrapping build depends. * Minimizing rules file. -- Daniel Baumann Mon, 03 Aug 2009 02:51:21 +0200 apachetop (0.12.6-10) unstable; urgency=low * Updating vcs fields in control file. * Using patch-stamp rather than patch in rules file. * Replacing obsolete dh_clean -k with dh_prep. * Prefixing debhelper files with package name. * Updating rules file to current state of the art. * Updating package to standards version 3.8.2. * Updating year in copyright file. * Using quilt rather than dpatch. * Using correct rfc-2822 date formats in changelog. -- Daniel Baumann Thu, 16 Jul 2009 23:47:02 +0200 apachetop (0.12.6-9) unstable; urgency=low * Reverting config.guess and config.sub to upstream. * Reordering rules file. * Rewriting copyright file in machine-interpretable format. * Adding vcs fields in control file. * Upgrading package to debhelper 7. * Updating to standards 3.8.0. -- Daniel Baumann Thu, 03 Jul 2008 15:34:00 +0200 apachetop (0.12.6-8) unstable; urgency=low * Bumpin to new policy. * Using new homepage field in control. * Don't hide make errors in clean target of rules. * Building with libgamin rather than libfam. -- Daniel Baumann Thu, 27 Dec 2007 08:38:00 +0100 apachetop (0.12.6-7) unstable; urgency=low * Fixed clean: target in rules (Closes: #424097). -- Daniel Baumann Tue, 15 May 2007 20:37:00 +0200 apachetop (0.12.6-6) unstable; urgency=low * Minor cleanups. * Bumped package to debhelper 5. * Set default logfile to /var/log/apache2/access.log (Closes: #396601). -- Daniel Baumann Sun, 29 Apr 2007 16:37:00 +0200 apachetop (0.12.6-5) unstable; urgency=low * New maintainer (Closes: #390215). * Redone debian directory based on current debhelper templates, additionally: - using dpatch for upstream modifications now. - updated upstream URL. -- Daniel Baumann Sat, 30 Sep 2006 01:11:30 +0200 apachetop (0.12.6-4) unstable; urgency=medium * Applied patch from Martin Michlmayr to build with gcc 4.1 (Close: #357644) * Applied patch for large file support from Sven Koch (Closes: #343180) * Updated URL in manpage, thanks to Mathieu De Zutter. (Closes: #358576) -- Steve Kemp Fri, 12 May 2006 15:39:27 +0000 apachetop (0.12.6-3) unstable; urgency=medium * Added a build dependency upon automake1.7 to avoid FTBFS on sparc/ia64 (Closes: #351322) -- Steve Kemp Sat, 18 Feb 2006 12:53:21 +0000 apachetop (0.12.6-2) unstable; urgency=low * New upstream with official fix for the security issue previously patched in the Debian package [CVE-2005-2660]. (Closes: #350046). * Reapplied change to allow both Apache 2.x + Apache 1.x logfiles to be detected by default. * Reapplied bugfix for memory corruption error. * Applied patch to fix memory leaks from Sven Koch. (Closes: #350225) * Avoid shipping autogenerated files in the Debian .diff.gz. Patch recieved with thanks from Sven Koch. (Closes: #350223) * Added a package dependency upon libpcre3-dev to allow filters to use regular expressions. (Closes: #350227) -- Steve Kemp Wed, 1 Feb 2006 19:32:37 +0000 apachetop (0.12.5-7) unstable; urgency=high * Fix a memory corruption error which renders the package unusable on sid. (Closes: #346101) -- Steve Kemp Thurs, 12 Jan 2006 12:09:58 +0000 apachetop (0.12.5-6) unstable; urgency=low * Applied patch from Sam Hocevar to allow more than 50 files to be read. (Closes: #334066) * Applied patch from Sven Koch to allow the package to be built repeatedly. (Closes: #343181) * Updated build dependencie to add libfam-dev + libadns1-dev. (Closes: #343179) -- Steve Kemp Fri, 16 Dec 2005 14:10:19 +0000 apachetop (0.12.5-5) unstable; urgency=high * *Really* include gamin as a dependency. -- Steve Kemp Fri, 30 Sep 2005 18:55:28 +0000 apachetop (0.12.5-4) unstable; urgency=high * *Really* include gamin as a dependency. -- Steve Kemp Fri, 30 Sep 2005 18:52:28 +0000 apachetop (0.12.5-3) unstable; urgency=high * Fix insecure temporary file usage. [CAN-2005-2660] * Support "gamin" in addition to "fam". (Closes: #329367) * Attempt to open both /var/log/apache2/access.log and /var/log/apache/access.log when given no filename as input. (Closes: #319272) -- Steve Kemp Fri, 30 Sep 2005 13:59:09 +0000 apachetop (0.12.5-2) unstable; urgency=medium * Changed build-dependencies to use libreadline5 rather than 4. (Closes: #326388) * Updated Debian standards to version 3.6.2. (No changes). -- Steve Kemp Sat, 3 Sep 2005 02:41:33 +0000 apachetop (0.12.5-1) unstable; urgency=low * New upstream release. * Improved compatability with GCC v3.4.x -- Steve Kemp Sat, 27 Nov 2004 15:26:17 +0000 apachetop (0.12-1) unstable; urgency=low * New upstream release. (Closes: #261499) * Use the new upstream manpage instead of our old and slightly incorrect one. (Closes: #257298) which highlighted one error in our own manpage. * Applied patch to hopefully compile the package on AMD64. (Closes: #258510) thanks to Andreas Jochens for the notice and fix. (Patch sent upstream too). * Added 'fam' as a dependancy, so that FAM support works correctly -- Steve Kemp Mon, 26 Jul 2004 15:08:31 +0000 apachetop (0.11-1) unstable; urgency=low * New upstream release. (Closes: #245965) * Correctly depend upon libreadline4, and build-depend upon libreadline4-dev -- Steve Kemp Mon, 26 Apr 2004 14:44:41 +0000 apachetop (0.10-1) unstable; urgency=low * New upstream release -- Steve Kemp Sun, 26 Jan 2004 16:24:08 +0000 apachetop (0.7-3) unstable; urgency=low * Applied patch to fix typo in manpage. (Closes: 217127) thanks to Wayne Conrad * Applied cleanup patch to fix manpage title, and install ChangeLog. (Closes: 215816) thanks to Gunnar Wolf -- Steve Kemp Wed, 12 Nov 2003 23:21:02 +0000 apachetop (0.7-2) unstable; urgency=low * Fixed up title of the manpage. * Removed duplicate changelog. * Fixed lintian warnings. Together these (Close: 215816) many thanks to Gunnar Wolf * Updated standards version to 3.6.1 (no changes). -- Steve Kemp Sun, 19 Oct 2003 22:07:12 +0000 apachetop (0.7-1) unstable; urgency=low * New upstream release. * Slowdown, I shall wait before this release gets into testing before uploading any new upstreams. -- Steve Kemp Tues, 14 Oct 2003 22:39:32 +0000 apachetop (0.6-1) unstable; urgency=low * New upstream release. * Included the upstream manpage instead of the previously written one. * Fixed the build-deps to include libncurses5 which prevented several successful builds. D'oh. -- Steve Kemp Sat, 11 Oct 2003 18:16:03 +0000 apachetop (0.4-1) unstable; urgency=low * Wrote manpage. * Changed default logfile to be /var/log/apache/access.log * Updated to Debian unstable repository (Closes: #213433) -- Steve Kemp Tue, 30 Sep 2003 15:11:42 +0100 debian/copyright0000644000000000000000000000370511701735050011125 0ustar Author: Chris Elsworth Download: http://www.webta.org/projects/apachetop/ Files: * Copyright: (C) 2003-2005 Chris Elsworth License: BSD Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Files: debian/* Copyright: (C) 2006-2009 Daniel Baumann License: BSD Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. debian/rules0000755000000000000000000000031011701735050010237 0ustar #!/usr/bin/make -f %: dh ${@} --with autoreconf override_dh_auto_configure: dh_auto_configure -- --bindir=\$${prefix}/sbin --with-logfile=/var/log/apache/access.log --with-no-fam --with-no-kqueue debian/source/0000755000000000000000000000000011701735050010465 5ustar debian/source/format0000644000000000000000000000001411701735050011673 0ustar 3.0 (quilt)