ftpwatch-1.21/0000755000000000000000000000000011606362614010150 5ustar ftpwatch-1.21/ftpwatch.pl0000755000000000000000000000603710517602550012332 0ustar #!/usr/bin/perl # ftpwatch - Simple script to notify you of changes on ftp servers # Copyright (C) 1997 Hakan Ardo # # 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 # 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., 675 Mass Ave, Cambridge, MA 02139, USA. $Tmp="/tmp/ftpwatch.$$"; $passive=0; $DiffOpt=''; foreach (@ARGV) { if (/^-d/) { s/^-d/-/; $DiffOpt.="$_ "; } if (/^-p/) { $passive=1; } } use Net::FTP; #open (PAS, ") { if (/^([^:]+):?(.{0,1}):(.+)$/) { $sv=$1; $rc=$2; $dir=$3; $file=undef; my $ftp = Net::FTP->new($sv, Debug => 0, Passive=>$passive); if (!$ftp) {print stderr "Connect failed: '$@'\n"; next} if (!$ftp->login) {print stderr "Login failed: '$@'\n"; next} if (!$ftp->cwd($dir)) { if ($dir =~ /^(.*)\/([^\/]+)$/) { $dir=$1; $file=$2; if (!$ftp->cwd($dir)) { print stderr "No such dir: '$dir'\n"; next } } else { print stderr "No such dir: '$dir'\n"; next } } open (T, ">$Tmp.2"); my @dr; if ($rc eq "R") {@dr=$ftp->dir("-R")} else { if (defined $file) {@dr=$ftp->dir($file)} else {@dr=$ftp->dir;} } foreach (@dr) { if (/^[\-dl]/ | (/^\// && /:\s*$/) && !/\s+\.\.?\s*$/ && !/^\-+\-$/) { s/^G//g; print T $_,"\n"; } } close (F); close(T); $ftp->quit; $cf="$sv$dir$rc"; if (defined $file) {$cf.="/$file";} $cf=~s/\//_/g; $cf="$ConfDir/$cf"; system ("diff $DiffOpt $cf $Tmp.2 > $Tmp.3"); system ("cp $Tmp.2 $cf"); ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime, $mtime,$ctime,$blksize,$blocks) = stat("$Tmp.3"); if ($size > 0) { system ("mail -s \"Ftp Update: $sv$dir\" $EMail< $Tmp.3"); } } system("rm $Tmp*"); } } ftpwatch-1.21/t20000644000000000000000000000004206727700566010426 0ustar open hobbe dir -R /pub/debian bye ftpwatch-1.21/Makefile0000644000000000000000000000015711606362065011613 0ustar all: echo All don! install: install -d $(DESTDIR)/usr/bin -cp ftpwatch.pl -d $(DESTDIR)/usr/bin/ftpwatch ftpwatch-1.21/debian/0000755000000000000000000000000011606362530011367 5ustar ftpwatch-1.21/debian/control0000644000000000000000000000110110517600326012761 0ustar Source: ftpwatch Section: main Priority: extra Maintainer: Hakan Ardo Build-Depends: debhelper Standards-Version: 3.2.1.0 Package: ftpwatch Section: net Architecture: all Depends: ${perl:Depends}, libnet-perl Description: Notifies you of changes on remote ftp servers This package should be installed as a cron job (for interested users) which every week makes a ftp connection to a list of sites and studies a set of files or directories and report any changes it finds by email. . Every user can have his own set of sites and directories to watch. ftpwatch-1.21/debian/compat0000644000000000000000000000000210517600301012554 0ustar 4 ftpwatch-1.21/debian/postinst.not0000755000000000000000000000020707712364213014001 0ustar #!/bin/sh -e PACKAGE="ftpwatch" # Source debconf library. . /usr/share/debconf/confmodule db_input high ftpwatch/info || true db_go ftpwatch-1.21/debian/templates.not0000644000000000000000000000501707443140704014113 0ustar Template: ftpwatch/info Type: note Description: The ftpwatch crontab installation is no longer automatic Due to security problems FTPWatch no longer installs itself in the root crontab file. But every user who wants to use it has to place it in their own crontabs. To get a weekly update as before the following line could be used: . "47 5 * * 7 /usr/sbin/ftpwatch" . This also means that all files in ~/.ftpwatch/ has to be chown'ed to be owned by the user instead of root Description-de: crontab-Installation von FTPWatch ist nicht mehr automatisch Aufgrund von Sicherheitsproblemen wird FTPWatch nicht mehr in der Haupt-crontab-Datei eingetragen. Jeder Benutzer, der FTPWatch benutzen möchte, kann es in seine eigene crontab-Datei aufnehmen. Um wöchtentliche Updates durchzuführen, kann die folgende crontab-Zeile genutzt werden: . "47 5 * * 7 /usr/sbin/ftpwatch" . Dies heisst auch, dass alle Dateien im Verzeichniss ~/.ftpwatch dem Benutzer anstatt root zugeordnet werden müssen. Description-es: La instalación del crontab de ftpwatch ya no es automática Debido a problemas de seguridad FTPWatch ya no se instala en el fichero crontab de root. Todos los usuarios que deseen usarlo tendrán que incluirlo en su propio crontab. Para obtener una actualización semanal como antes, se podría utilizar la siguiente línea: . "47 5 * * 7 /usr/sbin/ftpwatch" . Esto quiere decir también que todos los ficheros del directorio ~/.ftpwatch/ tienen que ser propiedad del usuario en lugar de root. Description-pt_BR: A instalação do crontab do ftpwatch não é mais automática Devido a problemas de segurança, o FTPWatch não mais se auto-instala no arquivo crontab do root. Sendo assim, cada usuário que deseja utilizá-lo deve colocá-lo em seu próprio crontab. Para obter uma atualização semanal como antes a seguinte linha poderia ser usada : . "47 5 * * 7 /usr/sbin/ftpwatch" . Isto significa também que todos os arquivos em ~/.ftpwatch tem de ser modificados para serem de propriedade do usuário ao invés do root. Description-ru: õÓÔÁÎÏ×ËÁ ftpwatch × crontab ÂÏÌØÛÅ ÎÅ Á×ÔÏÍÁÔÉÚÉÒÏ×ÁÎÁ éÚ-ÚÁ ÐÒÏÂÌÅÍ Ó ÂÅÚÏÐÁÓÎÏÓÔØÀ, FTPWatch ÂÏÌØÛÅ ÎÅ ÕÓÔÁÎÁ×ÌÉ×ÁÅÔ ÓÅÂÑ × crontab-ÆÁÊÌ root`Á. îÏ ÌÀÂÏÊ ÐÏÌØÚÏ×ÁÔÅÌØ, ËÏÔÏÒÙÊ ÈÏÞÅÔ ÅÇÏ ÉÓÐÏÌØÚÏ×ÁÔØ, ÍÏÖÅÔ ÐÏÍÅÓÔÉÔØ ÎÅÏÂÈÏÄÉÍÕÀ ÓÔÒÏËÕ × ÓÏÂÓÔ×ÅÎÎÙÊ crontab. äÌÑ ÅÖÅÎÅÄÅÌØÎÙÈ ÏÂÎÏ×ÌÅÎÉÊ ÍÏÖÎÏ ÕÓÔÁÎÏ×ÉÔØ ÓÌÅÄÕÀÝÕÀ ÚÁÐÉÓØ: . "47 5 * * 7 /usr/sbin/ftpwatch" . üÔÏ ÔÁËÖÅ ÏÚÎÁÞÁÅÔ, ÞÔÏ ×ÓÅ ÆÁÊÌÙ × ËÁÔÁÌÏÇÅ ~/.ftpwatch/ ÄÏÌÖÎÙ ÉÍÅÔØ ×ÌÁÄÅÌØÃÅÍ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÇÏ ÐÏÌØÚÏ×ÁÔÅÌÑ ×ÍÅÓÔÏ root. ftpwatch-1.21/debian/ftpwatch.substvars0000644000000000000000000000004011606362511015156 0ustar perl:Depends=perl misc:Depends= ftpwatch-1.21/debian/config0000755000000000000000000000016407036207457012573 0ustar #!/bin/sh -e # Source debconf library. . /usr/share/debconf/confmodule db_input high ftpwatch/info || true db_go ftpwatch-1.21/debian/changelog0000644000000000000000000001076511606362205013251 0ustar ftpwatch (1.21) unstable; urgency=low * Binary moved to /usr/bin (closes: #608940) -- Hakan Ardo Sun, 10 Jul 2011 19:42:29 +0200 ftpwatch (1.20) unstable; urgency=low * Applied patch from Pawel Tecza adding a -d option which passes as options to diff * Moved from debmake to debhelper (closes: #373002) * Added -p option to run ftp in passive mode -- Hakan Ardo Wed, 25 Oct 2006 08:35:22 +0200 ftpwatch (1.19) unstable; urgency=low * Removed debconf dependency (close: #331827) -- Hakan Ardo Tue, 27 Dec 2005 17:09:41 +0100 ftpwatch (1.18) unstable; urgency=low * Incoporated MNU (closes: #189715) * Removed reference to non excistent README.debian (closes: #292839) * Removed ancient (pre-stable) backwards compatibility warning -- Hakan Ardo Thu, 24 Feb 2005 11:42:21 +0100 ftpwatch (1.17.1) unstable; urgency=low * NMU. * Add Build-Depends-Indep on debhelper, debmake. Closes: #189715. * Remove /usr/doc/ftpwatch symlink. * Remove several cruft files from the source package. -- Daniel Schepler Thu, 31 Jul 2003 21:12:40 -0700 ftpwatch (1.17) unstable; urgency=low * Added russian debconf template (closes: #137650) -- Hakan Ardo Mon, 11 Mar 2002 15:37:46 +0100 ftpwatch (1.16) unstable; urgency=low * Added Brazilian portuguese (pt_BR) debconf template translation (Bug #120836) -- Hakan Ardo Sat, 12 Jan 2002 15:07:31 +0100 ftpwatch (1.15) unstable; urgency=low * Added spanish, german template file (Bug #103208, #101887) -- Hakan Ardo Sat, 7 Jul 2001 22:14:32 +0200 ftpwatch (1.14) unstable; urgency=low * Upgraded to policy v 3.2.1.0 * Fixed paragraph separateing in info template (Bug #85752) -- Hakan Ardo Sat, 7 Jul 2001 22:13:32 +0200 ftpwatch (1.13) unstable; urgency=low * Added some error checking * Added the posibility to watch single files -- Hakan Ardo Thu, 16 Nov 2000 10:39:08 +0100 ftpwatch (1.12) unstable; urgency=low * Now uses Net::FTP instead of ncftp * Updated docs to say that every user has to install a crontab entry -- Hakan Ardo Sun, 29 Oct 2000 13:48:09 +0100 ftpwatch (1.11) unstable; urgency=low * Now uses getpwent to get userinfo as sugested by Pierre -- Hakan Ardo Sat, 4 Mar 2000 12:20:50 +0100 ftpwatch (1.10) unstable; urgency=low * Now uses debconf * Docs and man pages moved to /usr/share * /usr/doc/... links created and removed -- Hakan Ardo Mon, 17 Jan 2000 10:52:59 +0100 ftpwatch (1.9) unstable; urgency=low * Fixed postinst bug -- Hakan Ardo Mon, 17 Jan 2000 10:32:38 +0100 ftpwatch (1.8) unstable; urgency=low * Fixed two spelling errors (Bug #42083) -- Hakan Ardo Mon, 10 Jan 2000 00:21:54 +0100 ftpwatch (1.7) unstable; urgency=low * Now uses dh_perl to get the right dependencies -- Hakan Ardo Thu, 1 Jul 1999 23:15:42 +0200 ftpwatch (1.6) unstable; urgency=low * Now depends on ncftp|ncftp2 instead of just ncftp (Bug #35159) -- Hakan Ardo Thu, 10 Jun 1999 11:16:09 +0200 ftpwatch (1.5) frozen unstable; urgency=high * Every user now has to place it in there crontabs (Fixes Bug#31627) * Only makes the checks for the user running it * Moved tmp files to user dir -- Hakan Ardo Tue, 19 Jan 1999 21:29:43 +0100 ftpwatch (1.4) unstable; urgency=low * Changelog now gziped * Moved back to main (Bug #25564) * No longer tries to create /usr/sbin (Bug #25787) * Paul J. Thompson has added support to watch sundirectoriees recoursly -- Hakan Ardo Tue, 2 Sep 1997 15:31:36 +0200 ftpwatch (1.3) unstable; urgency=low * Moved tmp file from /tmp to /var/run to fill a security hole (Bug #12291) -- Hakan Ardo Tue, 26 Aug 1997 14:34:25 +0200 ftpwatch (1.2) unstable; urgency=low * moved to contrib (Fixes Bug #9261) -- Hakan Ardo Thu, 1 May 1997 17:07:18 +0200 ftpwatch (1.1) unstable; urgency=low * Added man file -- Hakan Ardo Tue, 7 Jan 1997 21:44:35 +0100 ftpwatch (1.0) unstable; urgency=low * Initial Release. -- Hakan Ardo Tue, 7 Jan 1997 16:23:34 +0100 Local variables: mode: debian-changelog End: ftpwatch-1.21/debian/dirs0000644000000000000000000000002106264465170012254 0ustar usr/bin usr/sbin ftpwatch-1.21/debian/rules0000755000000000000000000000411611606362502012450 0ustar #!/usr/bin/make -f # Sample debian.rules file - for GNU Hello (1.3). # Copyright 1994,1995 by Ian Jackson. # I hereby give you perpetual unlimited permission to copy, # modify and relicense this file, provided that you do not remove # my name from the file itself. (I assert my moral right of # paternity under the Copyright, Designs and Patents Act 1988.) # This file may have to be extensively modified # # Modified to be a prototype for debmake by Christoph Lameter package=ftpwatch build: $(checkdir) if [ -x configure ]; then ./configure --prefix=/usr; fi make CFLAGS="-O2 -g -Wall" touch build clean: $(checkdir) -rm -f build -make clean -rm `find . -name "*~"` -rm -rf debian/tmp debian/files* core debian/substvars -rm -rf debian/$(package) binary-indep: checkroot build $(checkdir) # There are no architecture-independent files to be uploaded # generated by this package. If there were any they would be # made here. binary-arch: checkroot build $(checkdir) -rm -rf debian/tmp install -d debian/tmp cd debian/tmp;install -d `cat ../dirs` if [ -x configure ]; then make install prefix=`pwd`/debian/ftpwatch/usr ;\ else \ make install DESTDIR=`pwd`/debian/ftpwatch; \ fi # Must have debmake installed for this to work. Otherwise please copy # /usr/bin/debstd into the debian directory and change debstd to debian/debstd dh_perl # debstd # cp debian/config debian/templates debian/tmp/DEBIAN # mkdir debian/tmp/usr/share # mv debian/tmp/usr/doc debian/tmp/usr/share/doc # mv debian/tmp/usr/man debian/tmp/usr/share/man dh_installchangelogs dh_installdocs dh_installman ftpwatch.8 dh_compress dh_fixperms dh_installdeb dh_md5sums dh_gencontrol dh_builddeb # chown -R root.root debian/tmp # chmod -R go=rX debian/tmp # dpkg --build debian/tmp .. define checkdir test -f debian/rules endef # Below here is fairly generic really binary: binary-indep binary-arch source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false checkroot: $(checkdir) test root = "`whoami`" .PHONY: binary binary-arch binary-indep clean checkroot ftpwatch-1.21/debian/copyright0000644000000000000000000000015710207327133013321 0ustar This package was written by Hakan Ardo hakan@debian.org Copyright: GPL (See /usr/share/common-licenses/GPL) ftpwatch-1.21/debian/README.debian0000644000000000000000000000074006651170472013477 0ustar ftpwatch for DEBIAN ---------------------- Due to security problems FTPWatch no longer installs itselfe in the root crontab file. But every user who wants to use it has to place it in there own crontabs. To get a weekly update as before the following line could be used: 47 5 * * 7 /usr/sbin/ftpwatch This also means that all files in ~/.ftpwatch/ has to be chown'ed to be owned by the user instead of root. Hakan Ardo , Tue, 19 Jan 1999 21:47:44 +0100 ftpwatch-1.21/debian/ftpwatch.debhelper.log0000644000000000000000000000020511606362511015637 0ustar dh_perl dh_installchangelogs dh_installdocs dh_installman dh_compress dh_fixperms dh_installdeb dh_md5sums dh_gencontrol dh_builddeb ftpwatch-1.21/tst0000644000000000000000000000647706742210210010710 0ustar #!/usr/bin/perl -w # # Find dependencies on perl stuff # Remove .packlist files BEGIN { push @INC, "debian", "/usr/lib/debhelper" } use Dh_Lib; init(); my $perl = $ENV{PERL} || '/usr/bin/perl'; # Figure out the version of perl. If $ENV{PERL} is set, query the perl binary # it points to, otherwise query perl directly. my $version=sprintf("%.3f", $]); if (defined $ENV{PERL}) { $version=`$ENV{PERL} -e 'printf "%.3f", \$]'`; } foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); $EXT=pkgext($PACKAGE); my ($file, $v, $arch); my $dep_arch = ''; my $dep = ''; my $found = 0; # Look for perl modules and check where they are installed if (-d "$TMP/usr/lib/perl5") { foreach $file (split(/\n/,`find $TMP/usr/lib/perl5 -type f \\( -name "*.pm" -or -name "*.so" \\)`)) { $found++; if ($file =~ m<^$TMP/usr/lib/perl5/(\d\.\d{3})/([^/]+)/>) { $v = $1; $arch = $2; check_module_version ($v, $version); $v .= '-thread' if ($arch =~ /-thread/); $dep_arch = add_deps ($dep_arch, "perl-$v"); } elsif ($file =~ m<^$TMP/usr/lib/perl5/(\d.\d{3})/>) { $v = $1; check_module_version ($v, $version); $dep_arch = add_deps ($dep_arch, "perl-$v"); } } } if ($found and not $dep_arch) { $dep = "perl5"; } elsif ($dep_arch) { $dep = $dep_arch; } # Look for perl scripts my ($ff, $newdep); foreach $file (split(/\n/,`find $TMP -type f \\( -name "*.pl" -or -perm +111 \\)`)) { $ff=`file -b $file`; if ($ff =~ /perl/) { $newdep = dep_from_script ($file); $dep = add_deps ($dep, $newdep) if $newdep; } } # Remove .packlist files and eventually some empty directories if (not $dh{'K_FLAG'}) { foreach $file (split(/\n/,`find $TMP -type f -name .packlist`)) { unlink($file); # Get the directory name while ($file =~ s#/[^/]+$##){ last if (not -d $file); last if (not rmdir $file); } } } next unless $dep; if (-e "debian/$EXT\subtsvars") { open (IN, "; close IN; open (OUT, ">debian/$EXT\subtsvars"); print OUT @lines; } else { open (OUT, ">debian/$EXT\subtsvars"); } print OUT "perl:Depends=$dep\n"; close OUT; } sub add_deps { my ($dep, $new) = @_; # If $new = perl5 or perl5-thread check if perl-X.XXX(-thread)? # is not already in the dependencies if ($new eq "perl5") { return $dep if ($dep =~ m/(^|\s)perl-5\.\d{3}(\s|,|$)/); } elsif ($new eq "perl5-thread") { return $dep if ($dep =~ m/(^|\s)perl-5\.\d{3}-thread(\s|,|$)/); } if (not $dep) { $dep = $new; } else { $dep .= ", $new" unless ($dep =~ m/(^|\s)$new(\s|,|$)/); } return $dep; } sub check_module_version { my ($v1, $v2) = @_; unless ($v1 eq $v2) { warning("A module has been found in perl-$v1 arch directory. But perl-$v2 is the perl currently used ...\n"); } } sub dep_from_script { my $file = shift; my ($line, $perl, $dep); open (SCRIPT, "<$file") || die "Can't open $file: $!\n"; $line =