--- changetrack-3.18.orig/changeweb/changeweb.cgi
+++ changetrack-3.18/changeweb/changeweb.cgi
@@ -0,0 +1,485 @@
+#!/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
+
+
+
+
+
+
+ |
+Copyright © 2003 Cameron Morland
+Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
+ |
+
+
+";
--- changetrack-3.18.orig/changeweb/README
+++ changetrack-3.18/changeweb/README
@@ -0,0 +1,40 @@
+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 .
--- changetrack-3.18.orig/debian/dirs
+++ changetrack-3.18/debian/dirs
@@ -0,0 +1,7 @@
+etc/cron.hourly
+etc/cron.daily
+etc/default
+usr/bin
+usr/share/man/man1
+usr/share/doc/changetrack/examples
+var/lib/changetrack
--- changetrack-3.18.orig/debian/changelog
+++ changetrack-3.18/debian/changelog
@@ -0,0 +1,237 @@
+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
+
--- changetrack-3.18.orig/debian/changetrack.conf
+++ changetrack-3.18/debian/changetrack.conf
@@ -0,0 +1,20 @@
+## 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 /.
+
+## If you don't change /etc/default/changetrack, all 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/lprfilter
+#/root/.bashrc
+#/etc/printcap
+#/etc/news/leafnode/config
+#/etc/apt/preferences
--- changetrack-3.18.orig/debian/postrm
+++ changetrack-3.18/debian/postrm
@@ -0,0 +1,23 @@
+#! /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
--- changetrack-3.18.orig/debian/control
+++ changetrack-3.18/debian/control
@@ -0,0 +1,19 @@
+Source: changetrack
+Section: utils
+Priority: optional
+Maintainer: Jens Peter Secher
+Build-Depends: debhelper (>= 4.2.7)
+Standards-Version: 3.6.1
+
+Package: changetrack
+Architecture: all
+Depends: ${perl:Depends}, libmail-sendmail-perl, libfile-ncopy-perl
+Recommends: cron, rcs | ed
+Description: configuration-file change tracker
+ 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 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.
--- changetrack-3.18.orig/debian/cron.daily
+++ changetrack-3.18/debian/cron.daily
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+## 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
--- changetrack-3.18.orig/debian/defaults
+++ changetrack-3.18/debian/defaults
@@ -0,0 +1,12 @@
+## Default setting for changetrack. -*-shell-script-*-
+## This file is sources 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
--- changetrack-3.18.orig/debian/README.Debian
+++ changetrack-3.18/debian/README.Debian
@@ -0,0 +1,10 @@
+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
+
--- changetrack-3.18.orig/debian/TODO
+++ changetrack-3.18/debian/TODO
@@ -0,0 +1,6 @@
+changetrack (3.18-3) unstable; urgency=low
+
+ * Give changetrack a switch to use CVS instead of RCS (and send it
+ upstream).
+
+ -- Jens Peter Secher Tue, 27 Apr 2004 23:11:11 +0200
--- changetrack-3.18.orig/debian/compat
+++ changetrack-3.18/debian/compat
@@ -0,0 +1 @@
+4
--- changetrack-3.18.orig/debian/examples
+++ changetrack-3.18/debian/examples
@@ -0,0 +1 @@
+changeweb
--- changetrack-3.18.orig/debian/docs
+++ changetrack-3.18/debian/docs
@@ -0,0 +1 @@
+README
--- changetrack-3.18.orig/debian/copyright
+++ changetrack-3.18/debian/copyright
@@ -0,0 +1,26 @@
+This package was debianized by Jens Peter Secher
+on Wed, 25 Jul 2001 22:18:54 +0200.
+
+It was downloaded from
+http://www.eng.uwaterloo.ca/~cjmorlan/changetrack/
+
+Upstream Author: Cameron J. Morland
+
+ Copyright (C) 1999-2000 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+The full GNU General Public License is located in the file
+/usr/share/common-licenses/GPL on a Debian system.
--- changetrack-3.18.orig/debian/rules
+++ changetrack-3.18/debian/rules
@@ -0,0 +1,48 @@
+#!/usr/bin/make -f
+
+PACKAGE=changetrack
+SITE=http://www.eng.uwaterloo.ca/~cjmorlan/
+SOURCE=change
+MAJOR=3
+MINOR=18
+
+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
+
+clean:
+ dh_testdir
+ dh_testroot
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean
+ dh_installdirs
+ install -D -m 755 changetrack.pl 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
+
+.PHONY: build clean binary-indep binary-arch binary install get-orig-source
--- changetrack-3.18.orig/debian/cron.hourly
+++ changetrack-3.18/debian/cron.hourly
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+## 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
+
+[ -r ${CONFFILES_LIST:?} ] || /etc/cron.daily/changetrack
+
+[ -r ${CONFFILES_LIST:?} ] && nice $PROGRAM $PARAMS -c $CONFFILES_LIST > /dev/null 2>&1
--- changetrack-3.18.orig/debian/postinst
+++ changetrack-3.18/debian/postinst
@@ -0,0 +1,20 @@
+#!/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
--- changetrack-3.18.orig/debian/NEWS
+++ changetrack-3.18/debian/NEWS
@@ -0,0 +1,19 @@
+changetrack (3.18-5) unstable; urgency=low
+
+ * All conffiles on your system can now be tracked automatically by
+ changetrack if you change the settings in /etc/defaults/changetrack.
+
+ -- Jens Peter Secher Mon, 17 May 2004 23:50:34 +0200
+
+changetrack (3.17-1) unstable; urgency=low
+
+ * The internal representation of file permissions has changed. First
+ time changetrack is run, you will see a lot of comments about
+ "-rw-r--r--" changed to "644" or the like.
+
+ * The changeweb.cgi script is now included. It is intended to be used
+ as an interface for inspection of configuration-files changes. See
+ /usr/share/doc/changetrack/examples/changeweb.
+
+ -- Jens Peter Secher Mon, 21 Jul 2003 16:19:15 +0200
+
--- changetrack-3.18.orig/changetrack.pl
+++ changetrack-3.18/changetrack.pl
@@ -1,4 +1,4 @@
-#!%%PERLPATH%%
+#!/usr/bin/perl
# 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
@@ -14,8 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-%%DNCOPY%%use File::NCopy qw(copy);
-%%ENCOPY%%use File::Copy;
+use File::NCopy qw(copy);
use Getopt::Std;
use File::Path;
use strict;
@@ -24,19 +23,19 @@
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);
my ($configfile, $historypath);
if($< == 0) {
- $configfile = "%%ROOTCONFFILE%%";
- $historypath = "%%ROOTHISTORYPATH%%/";
+ $configfile = '/etc/changetrack.conf';
+ $historypath = '/var/lib/changetrack';
}
else {
- $configfile = $homedir . "%%USERCONFFILE%%";
- $historypath = $homedir . "%%USERHISTORYPATH%%/";
+ $configfile = $homedir . '.changetrackrc';
+ $historypath = $homedir . '.changetrack';
}
my $error = getopts('hc:d:a:m:erqM:vuo:f:');
@@ -157,6 +156,18 @@
next;
}
+ if( ! -f "$realfile" ) {
+ if(!$opt_q)
+ { print "Skipping non-archivable $realfile\n";}
+ next;
+ }
+
+ if( ! -r "$realfile" ) {
+ if(!$opt_q)
+ { print "Skipping non-existing $realfile\n";}
+ next;
+ }
+
$anyfile = 1; # at least one real file found
$compfile = $realfile; # file for comparison
@@ -372,10 +383,9 @@
# intermediate MTA before it is delivered to your mailbox (the old
# 'changetrack@localhost' address is blocked by some anti-spam filters).
-%%DSMAIL%%use Mail::Sendmail;
-%%ESMAIL%%exit();
+use Mail::Sendmail;
-my $mailfrom = '%%MAILFROM%%';
+my $mailfrom = 'changetrack@' . "$hostname";
# override by "from" address specified by -f on command line
if (defined($opt_f) && ($opt_f ne ''))
--- changetrack-3.18.orig/changetrack.man
+++ changetrack-3.18/changetrack.man
@@ -3,7 +3,7 @@
changetrack \- track changes to configuration 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
@@ -46,14 +46,14 @@
.BI \-c "configfile"
Get the list of files to track from
.I configfile
-instead of from ~/%%USERCONFFILE%%
-(%%ROOTCONFFILE%% for the super-user)
+instead of from ~/.changetrackrc
+(/etc/changetrack.conf for the super-user)
.TP
.BI \-d "outputdirectory"
Store output in
.I outputdirectory
-instead of in ~/%%USERHISTORYPATH%%/
-(%%ROOTHISTORYPATH%%/ for the super-user)
+instead of in ~/.changetrack/
+(/var/lib/changetrack/ for the super-user)
.TP
.BI \-e
Keep a copy of the file from when it was first added to the
@@ -95,9 +95,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,27 +111,33 @@
switch is used,
.B ed
is required.
+
.SH FILES
.TP
-~/%%USERCONFFILE%%
+~/.changetrackrc
List of files to monitor. Each line may start with '#' indicating a comment.
If a line is not a comment, it contains a file/pattern to monitor, and optionally
" : " followed by any email addresses to send changes to. The filename may
be a pattern described in the same way as for
.B ls.
Note: the default is
-.B %%ROOTCONFFILE%%
+.B /etc/changetrack.conf
for root.
.TP
-~/%%USERHISTORYPATH%%/
+~/.changetrack/
Default directory in which to store output information. The default is
-.B %%ROOTHISTORYPATH%%/
+.B /var/lib/changetrack/
for root. All
.B rcs
files are stored in this directory, unless a subdirectory called RCS
exists, in which case the
.B rcs
files are stored in that directory.
+.TP
+/etc/cron.daily/changetrack
+File that controls the automatic invocation of
+.B changetrack.
+
.SH DIAGNOSTICS
Each filename is written to standard output.
.B rcs
@@ -144,9 +150,11 @@
.br
Manual Page Revision: 2.1 Release Date: 2001-03-06.
.br
+Updated 2003-07-21 by Jens Peter Secher to accomodate for Debian features.
+.br
Copyright \(co 2001 Cameron J. Morland.
.SH "SEE ALSO"
-rcsintro(1), co(1)
+rcsintro(1), co(1), diff(1), ed(1)
.SH TODO
Automate removal of out-of-date changes, to save disk space and clarify