debian/0000755000000000000000000000000011552640173007172 5ustar debian/copyright0000644000000000000000000000200211552634556011127 0ustar This is the Debian package for changetrack. It was downloaded from http://changetrack.sourceforge.net/. Upstream Author: Cameron J. Morland Copyright (C) 1999-2006 Cameron J. Morland This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. The full GNU General Public License is located in the file /usr/share/common-licenses/GPL-2 on a Debian system. debian/changetrack.conf0000644000000000000000000000175211552634556012330 0ustar ## This is a list of files that you want changetrack to track. You ## can use ls-compatible wildcards, like /etc/h* or ## /opt/apache/cgi-bin/*.sh. If you omit the leading '/' then ## changetrack assumes that the files are relative to /. ## You can change /etc/default/changetrack so that all dpkg conffiles ## on your system will be tracked automatically. Any files you list ## here will then be tracked in addition to your conffiles. ## To email changes to users, use a line like: ## /etc/passwd : root@localhost foo@bar.com ## Note: one email will be sent to each user, unless none of the files ## monitored by that user are modified. #/boot/grub/menu.lst #/etc/aliases #/etc/apt/preferences #/etc/default/* #/etc/fetchmailrc #/etc/hosts #/etc/lprfilter #/etc/modprobe.d/blacklist #/etc/network/* #/etc/news/leafnode/config #/etc/pam.d/* #/etc/printcap #/etc/samba/smb.conf #/etc/snort/snort.debian.conf #/etc/squid/squid.conf #/etc/ssh/sshd_config #/etc/sudoers #/root/.bash* #/root/.profile debian/dirs0000644000000000000000000000002411552634556010062 0ustar var/lib/changetrack debian/changelog0000644000000000000000000002536711552640107011056 0ustar changetrack (4.7-1) unstable; urgency=low * New upstream version. (Closes: #616370) * Patch reject-weird-filenames is now included upstream. * Bump Standards-Version to 3.9.2, no change. -- Jens Peter Secher Sun, 17 Apr 2011 21:03:11 +0200 changetrack (4.5-4) unstable; urgency=low * Converted to dpkg-source format 3.0 (quilt). * Depend on ${misc:Depends}. -- Jens Peter Secher Sun, 17 Apr 2011 20:42:05 +0200 changetrack (4.5-3) unstable; urgency=medium * [reject-weird-filenames.diff] Also reject filenames with exclamation marks, avoid spaces in auxiliary files, and quote filenames whereever possible. Urgency due to security implications. -- Jens Peter Secher Sun, 20 Sep 2009 15:01:44 +0200 changetrack (4.5-2) unstable; urgency=low * [reject-weird-filenames.diff] Fix possible local exploit by rejecting filenames with unsafe characters (cf. CVE-2009-3233). Thanks to Marek Grzybowski and Andrzej Lemieszek. (Closes: #546791) -- Jens Peter Secher Thu, 17 Sep 2009 22:32:43 +0200 changetrack (4.5-1) unstable; urgency=low * New upstream version. * Use quilt instead of dpatch for patches, and describe how to use quilt in Debian.source (thanks to Russ Allbery). * Added a Vcs-Hg control filed to indicate the location of the public repository. * Added Homepage for upstream. * Upgraded to Standards-Version to 3.8.1 and debhelper compatibility to 7. -- Jens Peter Secher Sat, 18 Apr 2009 21:43:09 +0200 changetrack (4.3-3) unstable; urgency=low * Send mail via /usr/sbin/sendmail instead of Mail::Sendmail to avoid assuming that there is something listening on port 25, thanks to Ian Zimmerman. (Closes: bug#367987) * Bump Standards-Version to 3.7.1 and debhelper compatibility to 5. -- Jens Peter Secher Sat, 20 May 2006 15:58:43 +0200 changetrack (4.3-2) unstable; urgency=low * Update FSF address in copyright file. * Updated upstream contact points. * Bump Standards-Version to 3.6.2. -- Jens Peter Secher Wed, 28 Sep 2005 10:49:50 +0200 changetrack (4.3-1) unstable; urgency=low * New upstream release. -- Jens Peter Secher Wed, 27 Apr 2005 20:17:26 +0200 changetrack (3.18-8) unstable; urgency=low * Escaped hyphens in manpage where necessary to distinguish hard from soft hyphens. * Changed comments in conf file to match the default settings. -- Jens Peter Secher Wed, 27 Apr 2005 20:11:07 +0200 changetrack (3.18-7) unstable; urgency=low * cron.hourly: Fixed compatibility problem by using "=" instead of "==" (closes: bug#293295) and improved comments. * watch: Anticipate a change to uscan that makes it possible to extract weird upstream version numbering, see bug#282255. -- Jens Peter Secher Sun, 6 Feb 2005 20:58:48 +0100 changetrack (3.18-6) unstable; urgency=low * Do not track Gnome schema files automatically, thanks to Achim Bohnet. (closes: bug#265143) -- Jens Peter Secher Mon, 16 Aug 2004 22:56:14 +0200 changetrack (3.18-5) unstable; urgency=low * Set AUTO_TRACK_ALL_CONFFILES=no be default to avoid annoying space-conscious, thanks to Ingmar Schrey. (closes: bug#249451) -- Jens Peter Secher Mon, 17 May 2004 23:44:07 +0200 changetrack (3.18-4) unstable; urgency=low * cron.hourly boot-straps by running cron.daily. * Ignore non-files, thanks to Markus Kucborski. -- Jens Peter Secher Mon, 3 May 2004 19:46:17 +0200 changetrack (3.18-3) unstable; urgency=low * Include examples of what I use in the /etc/changetrack.conf. * Run cronjobs using nice. -- Jens Peter Secher Mon, 26 Apr 2004 22:37:04 +0200 changetrack (3.18-2) experimental; urgency=low * Automatically place all conffiles under the prying eyes of changetrack. * Run changetrack hourly. * Changed Build-Depends-Indep to Build-Depends because dh_clean in used in clean target. -- Jens Peter Secher Mon, 29 Mar 2004 00:36:23 +0200 changetrack (3.18-1) unstable; urgency=low * New upstream release * Corrected Maintainer and Section fields. -- Jens Peter Secher Thu, 11 Sep 2003 23:01:06 +0200 changetrack (3.17-3) unstable; urgency=low * Patch to use fully qualified domain name in From and To fields when emailing result. Thanks to Nathaniel W. Turner (closes: bug#207152) -- Jens Peter Secher Sun, 7 Sep 2003 22:07:21 +0200 changetrack (3.17-2) unstable; urgency=medium * Patch changetrack to avoid security problem when using ed scripts instead of RCS. Send upstream as well. -- Jens Peter Secher Sun, 27 Jul 2003 22:24:16 +0200 changetrack (3.17-1) unstable; urgency=low * New upstream release with my patch to alleviate changetrack from susceptibility to the output format of ls. Thanks to Nathaniel W. Turner, Michael Stone and Ron Murray for complaining. (closes: #193492,196494) * Bundle changeweb.cgi which can assist remote monitoring. * Clean-up and extend the use of debhelper and move to compatibility level four, and refrain from using debconf. -- Jens Peter Secher Mon, 21 Jul 2003 16:19:15 +0200 changetrack (3.16-5) unstable; urgency=low * debian/rules: make var/lib/changetrack directory the rigth place. (closes: bug#179032) -- Jens Peter Secher Sat, 1 Feb 2003 09:38:41 +0100 changetrack (3.16-4) unstable; urgency=low * debian/cron.daily: Correct misspelling. -- Jens Peter Secher Wed, 30 Oct 2002 12:13:07 +0100 changetrack (3.16-3) unstable; urgency=low * Re-hardwired all settings in the Perl script, since they are not likely to change. debian/installer is thus eliminated. * Bumped Standards-Version: 3.5.7. -- Jens Peter Secher Thu, 26 Sep 2002 19:52:01 +0200 changetrack (3.16-2) unstable; urgency=low * debian/installer: Added PERLPATH (without which changetrack did not work). * Made changetrack take the hostname from the environment. -- Jens Peter Secher Sat, 21 Sep 2002 18:09:24 +0200 changetrack (3.16-1) unstable; urgency=low * New upstream release. -- Jens Peter Secher Sat, 27 Jul 2002 23:51:06 +0200 changetrack (3.12-3) unstable; urgency=low * Applied patch so that the "From" header can be set by an "-f" option. (closes: bug#144529) -- Jens Peter Secher Fri, 26 Apr 2002 16:33:46 +0200 changetrack (3.12-2) unstable; urgency=low * Added Russian template for one of the debconf questions, thanks to Ilgiz Kalmetev. (closes: bug#137624) * Make sure the history & statistics files are writable. -- Jens Peter Secher Tue, 23 Apr 2002 16:30:30 +0200 changetrack (3.12-1) unstable; urgency=low * New upstream release -- Jens Peter Secher Fri, 19 Apr 2002 11:56:11 +0200 changetrack (3.11-1) unstable; urgency=low * Changed dependency of cron to suggestion. * Do not move old repository. -- Jens Peter Secher Thu, 18 Apr 2002 18:11:49 +0200 changetrack (3.9-1) unstable; urgency=low * New upstream version: Uses File::NCopy perl module, which means that the repository (/var/lib/changetrack) does have to be for root's eyes only. * Default behaviour is now to send email to root@localhost . * Simplified configuration (removed unnecessary debconf stuff). -- Jens Peter Secher Wed, 20 Feb 2002 23:23:44 +0100 changetrack (3.7-3) unstable; urgency=low * Removed /etc/default/changetrack from conffiles and specifically remove it in postrm. -- Jens Peter Secher Thu, 29 Nov 2001 13:34:50 +0100 changetrack (3.7-2) unstable; urgency=low * Changed sender address to "changetrack@localhost". -- Jens Peter Secher Thu, 29 Nov 2001 13:34:50 +0100 changetrack (3.7-1) unstable; urgency=low * New upstream version: make program quieter when desired. * Do not overwrite existing default file /etc/default/changetrack if it exists (postinst). * Bumped Standards-Version: 3.5.6. -- Jens Peter Secher Wed, 28 Nov 2001 12:42:25 +0100 changetrack (3.6-4) unstable; urgency=low * Fix the permission in of /var/lib/changetrack in postinst. -- Jens Peter Secher Mon, 29 Oct 2001 10:25:17 +0100 changetrack (3.6-3) unstable; urgency=high * Fix the permission of /var/lib/changetrack by excluding it from dh_fixperms treatment. (closes: bug#117075) * Removed obsolete info from man page. * Additional clean-up. -- Jens Peter Secher Fri, 26 Oct 2001 09:56:53 +0200 changetrack (3.6-2) unstable; urgency=low * In postrm: "rm -rf /var/lib/changetrack/*" --> "rm -rf /var/lib/changetrack" . -- Jens Peter Secher Fri, 5 Oct 2001 09:17:51 +0200 changetrack (3.6-1) unstable; urgency=low * New upstream release -- Jens Peter Secher Wed, 3 Oct 2001 09:53:03 +0200 changetrack (3.5-4) unstable; urgency=low * Changed "Build-Depends" to "Build-Depends-Indep" in control, as required by policy 7.6. * Changed "Upstream Authors" to "Upstream Author". * Added a debian/watch file to facilitate automatic upstream updates. -- Jens Peter Secher Wed, 3 Oct 2001 09:42:20 +0200 changetrack (3.5-3) unstable; urgency=low * Unnecessary information about old versions and dependencies have been removed from the documentation. * Use debconf to ask questions. * Enabled report to a list of users through email. * Removed changeweb package suggestion (and fixed the rest). -- Jens Peter Secher Sun, 9 Sep 2001 10:54:16 +0200 changetrack (3.5-2) unstable; urgency=low * Parameters can be set in /etc/default/changetrack file. Initially copied from file ./defaults . * Changed perl module dependencies to libxxx-yyy-perl. * For non-root users, the defaults configuration file is now ~/.changetrackrc and the output directory is ~/.changetrack/ . * The debian/copyright now refers to GPL (instead of quoting it). -- Jens Peter Secher Thu, 23 Aug 2001 14:55:18 +0200 changetrack (3.5-1) unstable; urgency=low * Initial Release. * Created a Makefile from scratch. * Made changetrack operate quietly and check existence of changetrack when invoked from the cron.daily script. -- Jens Peter Secher Fri, 17 Aug 2001 13:21:12 +0200 debian/rules0000755000000000000000000000176111552636466010271 0ustar #!/usr/bin/make -f # debian/rules for changetrack. PACKAGE=changetrack SITE=http://changetrack.sourceforge.net/ SOURCE=change MAJOR=4 MINOR=7 get-orig-source: wget $(SITE)/$(SOURCE)$(MAJOR)_$(MINOR).tar.gz ln -s $(SOURCE)$(MAJOR)_$(MINOR).tar.gz $(PACKAGE)-$(MAJOR).$(MINOR).tar.gz build: dh_testdir install: build dh_testdir dh_testroot dh_clean dh_installdirs install -D -m 755 changetrack debian/$(PACKAGE)/usr/bin/changetrack install -D -m 644 debian/changetrack.conf debian/$(PACKAGE)/etc/changetrack.conf install -D -m 644 debian/defaults debian/$(PACKAGE)/etc/default/changetrack dh_installman changetrack.man binary-indep: build install dh_installdocs dh_installexamples dh_installchangelogs dh_installcron dh_compress dh_fixperms dh_installdeb dh_perl dh_gencontrol dh_md5sums dh_builddeb binary-arch: build install binary: binary-indep binary-arch clean: dh_testdir dh_testroot dh_clean .PHONY: build clean binary-indep binary-arch binary install get-orig-source debian/source/0000755000000000000000000000000011552634556010502 5ustar debian/source/format0000644000000000000000000000001411552634556011710 0ustar 3.0 (quilt) debian/control0000644000000000000000000000170311552640060010571 0ustar Source: changetrack Section: utils Priority: optional Maintainer: Jens Peter Secher Build-Depends: debhelper (>= 7) Standards-Version: 3.9.2 Vcs-Hg: http://hg.debian.org/hg/collab-maint/changetrack/changetrack Homepage: http://changetrack.sourceforge.net Package: changetrack Architecture: all Depends: ${misc:Depends}, ${perl:Depends} Recommends: cron, ed | rcs Description: monitor changes to (configuration) files A program to automatically monitor changes to a set of files. If files are modified one day, and the machine stops working correctly some days later, changetrack provides information on which files were modified, and thus helps locate the problem. If you tell changetrack to use either the line editor ed (the default) or The Revision Control System (RCS), you can recover files to any previous stage. If you do not want to install Perl, try out the filetraq or diffmon package. Another similar program is etckeeper. debian/README.Debian0000644000000000000000000000040711552634556011244 0ustar changetrack for Debian ---------------------- * See /etc/default/changetrack for how to configure changetrack. * The CGI script changeweb is included as an example of remote monitoring. -- Jens Peter Secher , Mon Apr 26 22:30:19 2004 debian/compat0000644000000000000000000000000211552634556010400 0ustar 7 debian/patches/0000755000000000000000000000000011552636031010617 5ustar debian/patches/series0000644000000000000000000000003311552635751012040 0ustar hostname.diff manpage.diff debian/patches/hostname.diff0000644000000000000000000000121011552636007013264 0ustar ## hostname.diff by Jens Peter Secher ## ## Use fully qualified hostname when non is specified. Index: changetrack/changetrack =================================================================== --- changetrack.orig/changetrack 2011-04-17 21:03:11.000000000 +0200 +++ changetrack/changetrack 2011-04-17 21:14:03.000000000 +0200 @@ -40,7 +40,7 @@ my $version = $temp[1]; my $homedir = $ENV{"HOME"} || $ENV{"LOGDIR"} || (getpwuid($<))[7]; -my $hostname = `hostname`; chomp($hostname); +my $hostname = `hostname -f`; chomp($hostname); if(substr($homedir,-1,1) ne "/") {$homedir = $homedir . "/";} my ($rcs_quiet, $diffargs); debian/patches/manpage.diff0000644000000000000000000000516211552636031013065 0ustar ## manpage.diff by Jens Peter Secher ## ## Describe -f option. ## Describe cron files. Index: changetrack/changetrack.man =================================================================== --- changetrack.orig/changetrack.man 2011-04-17 21:03:11.000000000 +0200 +++ changetrack/changetrack.man 2011-04-17 21:14:20.000000000 +0200 @@ -1,13 +1,13 @@ .TH CHANGETRACK 1 "" "" \" -*- nroff -*- .SH NAME -changetrack \- track changes to configuration files +changetrack \- track changes to files .SH SYNOPSIS .B changetrack -[-h] [\-c configfile] [\-d directory] [-e] [-r] [-q] [\-m message] [\-M message] [-v] [-u] [\-o emailaddress] +[-h] [\-c configfile] [\-d directory] [\-e] [\-r] [\-q] [\-m message] [\-M message] [\-v] [\-u] [\-o toaddress] [\-f fromaddress] .SH DESCRIPTION .B changetrack is a program to monitor changes to a bunch of files. If files are -modify one day, and the machine starts working incorrectly some days later, +modified one day, and the machine starts working incorrectly some days later, .B changetrack can provide information on which files were modified, and help locate the problem. @@ -15,6 +15,14 @@ Normally .B changetrack uses +.B ed +to keep track of various revisions of the files by maintaining an +.I .ed +script with the change history for each file. +.PP +Alternatively, +.B changetrack +can use .B rcs to keep track of various revisions of the files. Each file is "installed" in the @@ -95,9 +103,9 @@ .TP .BI \-o "emailaddress" Mail output to emailaddress. This is supplementary to emails specified in the config file. -+ .TP -+ .BI \-f "emailaddress" -+ Set "From" header to emailaddress (which must be a valid). +.TP +.BI \-f "emailaddress" +Set "From" header to emailaddress, which must be fully qualified. .SH REQUIREMENTS This program requires @@ -111,6 +119,7 @@ switch is used, .B ed is required. + .SH FILES .TP ~/.changetrackrc @@ -132,6 +141,17 @@ exists, in which case the .B rcs files are stored in that directory. +.TP +/etc/cron.daily/changetrack +Script that creates the list of all files monitor. +.TP +/etc/cron.hourly/changetrack +Script that invocates +.B changetrack. +.TP +/etc/default/changetrack +Configuration for the above two scripts. + .SH DIAGNOSTICS Each filename is written to standard output. .B rcs @@ -145,8 +165,10 @@ Manual Page Revision: 2.1 Release Date: 2001-03-06. .br Copyright \(co 2001-2005 Cameron J. Morland. +.br +Changed by Jens Peter Secher to reflect the Debian modifications. .SH "SEE ALSO" -rcsintro(1), co(1) +ed(1), rcsintro(1), co(1) .SH TODO Automate removal of out-of-date changes, to save disk space and clarify debian/changeweb/0000755000000000000000000000000011552634556011125 5ustar debian/changeweb/changeweb.cgi0000644000000000000000000002540511552634556013542 0ustar #!/usr/bin/perl $version = 0.02; $this = "changeweb.cgi"; $path = "/var/lib/changetrack/"; @months = ("","January","February","March","April","May","June","July","August","September","October","November","December"); # couldn't be zero-based because I want the months to be all true. # Also I think there's some other reason it didn't work. use Text::ParseWords; use Time::Local; print "Content-type: text/html\n\n"; $| = 1; # flush STDOUT open(STDERR,">&STDOUT"); # let the web user see any errors. $args = $ENV{QUERY_STRING}; # translate ampersands to semicolons, so we can be W3C compliant. while($args =~ m/&/) { $args =~ s/&/;/; } $args = $args . ";"; @ARGV = quotewords(";",0,$args); %things = {}; foreach $arg (@ARGV) { $arg = $arg . "="; ($thing,$value) = quotewords("=",0,$arg); if(!$value) {$value=1;} $things{$thing} = $value; } $year = $things{"year"}; if(!$year) {$year = 1999;} $month= $things{"month"};if(!$month){$month= 1;} $day = $things{"day"}; if(!$day) {$day = 1;} elsif($day > 31) {$day = 31;} $file = $things{"file"}; while($file =~ m/\.\./) {$file =~ s/\.\.//;} $sort = $things{"sort"}; if(!$sort || $sort == 1) {$sort = "";} # deals with 'sort=' url problem $date = timelocal(0,0,0,$day,$month-1,$year-1900); # feel free to add other groups of servers to monitor. # note that each needs to have the same setup as the current ones; # that should be cleaned up. if($file) { $file =~ s/\.history//; $title = $file; $file .= ".history"; while($title =~ m/:/) {$title =~ s/:/\//} $title = $title; } else { $title = "Changetrack: $months[$month] $day, $year"; } print " $title

$title

"; print "
"; # needs to be a table to be in one line. print " Since: "; print ""; print "
"; # table to keep arrows in place print " "; print ""; print "
\n"; # table to put arrows above each other if($month < 12) # month 'up' arrow { # not into next year; increment month print ""; } else { # next year; month -> Jan print ""; } #print ""; print "+"; print ""; print "
"; if($month > 1) # month 'down' arrow { print ""; } else { print ""; } #print ""; print "-"; print ""; print "
"; print "
"; print "
"; print "
"; print ""; print ""; print "
"; @lens = (0,31,29,31,30,31,30,31,31,30,31,30,31); # Easiest to just assume Feb is always long. $monlen = $lens[$month]; if($day < $monlen) {print "";} else { if($month < 12) {print "";} else {print "";} } #print ""; print "+"; print ""; print "
"; if($day > 1) {print "";} else { if($month > 1) {print "";} else {print "";} } #print ""; print "-"; print ""; print "
"; print "
"; print "
"; print ""; print ""; print "
\n"; @i = stat "$path/etc:shutdownlog.history"; ($i,$i,$i,$bootday,$bootmonth,$bootyear,$i,$i,$i) = localtime($i[9]); $bootmonth++; $bootyear += 1900; print "
"; if($file) { open(FILE,"$path/$file") or die "Can't open $path/$file: $!\n"; print "
";
	$found = 0;
	if(($month >= 1) && ($month <= 12))
		{
		while()
	 		{
	    $line = $_;
	    if(substr($line,0,2) ne "  ")
	     	{
	     	$fyear = substr($line,36,4);
				$fmonth= substr($line,20,3);
				$fday  = substr($line,24,2);	

				if(!$fday || !$fmonth || !$fyear)
					{
					next;	
					}

				# this is for reading from the file.
				($fmonth =~ s/Jan/1/) || ($fmonth =~
s/Feb/2/) || ($fmonth =~ s/Mar/3/) ||
					($fmonth =~ s/Apr/4/) || ($fmonth =~
s/May/5/) || ($fmonth =~ s/Jun/6/) ||
	        ($fmonth =~ s/Jul/7/) || ($fmonth =~ s/Aug/8/) || ($fmonth
=~ s/Sep/9/) ||
	        ($fmonth =~ s/Oct/10/)|| ($fmonth =~ s/Nov/11/)|| ($fmonth
=~ s/Dec/12/);

				$fdate =
timelocal(0,0,0,$fday,$fmonth-1,$fyear-1900); 
				if($fdate >= $date)
					{
	        print $line;
	        $found++;
	        last;   
					}
				}
      }       
    }

	if(!$found) {print "No changes since that date.\n";}

	while()
    {
    print $_;       
    }
	close(FILE);
	print "
"; } else { print "\n"; print "\n"; $selectedc = "#b0b0b0"; if(!$sort) { print "\n"; if($sort eq "name") { print "\n"; if($sort eq "size") { print "\n"; if($sort eq "date") { print "\n"; # There is no file, so show the directory listing. chdir("$path"); open(LS,"ls *.history |") or die "Can't open ls $path: $!\n"; $j = 1; @files = (); while() { # list the files chomp; $cname = $_; $hname = $_; @finfo = stat $cname; @fmdate = localtime($finfo[9]); $fyear = $fmdate[5] + 1900; $fmonth= $fmdate[4] + 1; $fday = $fmdate[3]; $filesize = $finfo[7]; $fdate = $finfo[9]; $fdate = substr($fdate,0,10)." ".substr($fdate,-4,4); if(($month < 1) || ($month > 12)) {$fyear = 65535} #while($hname =~ m/:/) {$hname =~ s/:/\//;} $hname =~ s/.history$//; if($finfo[9] >= $date) { if($sort eq "size") { $line = "$filesize\t$cname\t$fdate\t$j\t"; } elsif($sort eq "date") { $line = "$fdate\t$filesize\t$cname\t$j\t"; } else { # name or invalid $line = "$cname\t$filesize\t$fdate\t$j\t"; } @files = (@files,$line); } else { next; # we can ignore this file. } while($hname =~ m/:/) {$hname =~ s/:/\//;} $hname =~ s/\.history$//; $j++; } if($sort) { if($sort eq "name") {@files = sort @files;} else { # descending numeric sort # shows largest/newest files first. sub numerically {$b <=> $a} @files = sort numerically @files; } } # extract everything from the list, and print it. $j = 0; foreach $file (@files) { if($j%10 < 5) { $color = "#ffffff"; $hcolor= "#e4e4e4"; } else { $color = "#ddddff"; $hcolor= "#ddddff"; } $j++; if($sort eq "size") { ($fsize,$fname,$fdate,$fnum) = quotewords("\t",0,$file); } elsif($sort eq "date") { ($fdate,$fsize,$fname,$fnum) = quotewords("\t",0,$file); } else { # name or invalid ($fname,$fsize,$fdate,$fnum) = quotewords("\t",0,$file); } $fdate = scalar localtime($fdate); $fdate = substr($fdate,0,11) . substr($fdate,-4,4); $hname = $fname; while($hname =~ m/:/) {$hname =~ s/:/\//;} $hname =~ s/\.history$//; $fname = "$hname"; print ""; if($sort eq "name") { print ""; } elsif($sort eq "size") { print ""; } elsif($sort eq "date") { print ""; } else { print ""; } print "\n"; } print "
"; print "
[--]"; } else { print "
"; print "[--] "; } print "
"; print "
Filename"; } else { print "
"; print "
Filename"; } print "
"; print "
Log Size"; } else { print "
"; print "
Log Size"; } print "
"; print "
Date Modified"; } else { print "
"; print "Date Modified"; } print "
$fnum$fname$fsize$fdate$fnum$fname$fsize$fdate$fnum$fname$fsize$fdate$fnum$fname$fsize$fdate
"; if($month > 0 && $month < 13) {print "$j files modified since $months[$month] $day, $year.";} close(LS); } print "

\"Valid Copyright © 2003 Cameron Morland Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
"; debian/changeweb/README0000644000000000000000000000300211552634556012000 0ustar USE This program is a cgi script intended to be used as an interface for changetrack, available from . It allows display of changetrack log files, sorting by date, size, and filename. Files listed can also be made to only show what modifications have been made since a specific date. The httpd probabaly runs as nobody, so that user must be able to read the log files for this to work. Consider the security implications of this move. INSTALLATION REQUIREMENTS This program is useless unless changetrack is installed. changeweb requires Perl to be installed. INSTALLATION To install changeweb, copy it to the cgi-bin directory for your web server, then ensure that it can be run by 'nobody', or whatever uid the server runs as. Take note that changeweb assumes that the changetrack files are stored in /var/lib/changetrack/, which is the default. A different location can be selected by modifying the "$path = " line in changeweb. The cgi-bin directory is likely /opt/apache/cgi-bin/ on Suns, /usr/lib/cgi-bin on Debian, and /home/httpd/cgi-bin/ on other machines. Consider the security implications of allowing anyone to see information about the system configuration. Implementing a password for web-users of this program may be a good idea. TODO * Make it work with one web server, and multiple monitored computers, instead of requiring each monitored computer to run a web server. GETTING CHANGEWEB/CHANGETRACK Changetrack is available from . debian/cron.daily0000644000000000000000000000152211552634556011167 0ustar #!/bin/sh ## ## This code was put in the Public Domain by Jens Peter Secher. ## ## No arms, no cookies PROGRAM=/usr/bin/changetrack [ -x $PROGRAM ] || exit 0 ## Get default settings [ -r /etc/default/changetrack ] && . /etc/default/changetrack ## Clear list of tracked files cat /dev/null > ${CONFFILES_LIST:?} ## Collect administrators choice of tracked files [ -r /etc/changetrack.conf ] && cat /etc/changetrack.conf >> $CONFFILES_LIST if [ "${AUTO_TRACK_ALL_CONFFILES}" = "yes" ]; then ## Collect all conffiles known to dpkg, except for gnome schema ## files since they get very large and their diff is not of much ## use. nice \ find /var/lib/dpkg/info -name '*.conffiles' -exec grep -v '.schemas$' '{}' ';' | \ sort | uniq >> $CONFFILES_LIST fi ## The actual tracking is performed by /etc/cron.hourly/changetrack debian/cron.hourly0000644000000000000000000000126611552634556011414 0ustar #!/bin/sh ## ## This code was pu in the Public Domain by Jens Peter Secher. ## ## No arms, no cookies PROGRAM=/usr/bin/changetrack [ -x $PROGRAM ] || exit 0 ## Get default settings [ -r /etc/default/changetrack ] && . /etc/default/changetrack ## If RCS is not installed, do not use it if [ ! -x /usr/bin/rcs ]; then PARAMS="-r $PARAMS" ## If ed is available, use him instead if [ -x /bin/ed ]; then PARAMS="-e $PARAMS" fi fi ## Try to generate a list of files to watch [ -r ${CONFFILES_LIST:?} ] || /etc/cron.daily/changetrack ## Only run if there is a list of files to watch [ -r ${CONFFILES_LIST:?} ] && nice $PROGRAM $PARAMS -c $CONFFILES_LIST > /dev/null 2>&1 debian/postinst0000644000000000000000000000065611552634556011017 0ustar #!/bin/sh set -e ## The version in Woody had a now obsolete question about a defaults ## file. We do not need that question anymore. if dpkg --compare-versions 3.7-3 le-nl "$2"; then # Source debconf library, if present. if [ -e /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule ## Remove all questions in the debconf database. db_purge fi fi #DEBHELPER# exit 0 debian/docs0000644000000000000000000000000711552634556010052 0ustar README debian/defaults0000644000000000000000000000074711552634556010744 0ustar ## Default setting for changetrack. -*-shell-script-*- ## This file is sourced from /etc/cron.{hourly,daily}/changetrack. ## Standard parameters: quiet, unified diffs, and mail to root. PARAMS="-q -u -o root@`/bin/hostname -f`" ## The location of the list of conffiles CONFFILES_LIST=/var/lib/changetrack/all_conffiles.txt ## When set to yes, all conffiles on your system is tracked for changes ## in addition to the ones you put in /etc/changetrack.conf AUTO_TRACK_ALL_CONFFILES=no debian/watch0000644000000000000000000000012611552634556010232 0ustar version=3 http://changetrack.sourceforge.net/ change([0-9]+)_([0-9]+)\.tar\.gz debian debian/postrm0000644000000000000000000000056411552634556010456 0ustar #! /bin/sh # postrm script for changetrack set -e case "$1" in purge) ## Remove the repository rm -rf /var/lib/changetrack ;; remove) ;; upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 0 esac #DEBHELPER# exit 0 debian/examples0000644000000000000000000000002111552634556010734 0ustar debian/changeweb