I had not cleaned the source package before producing the patch sent previously. Please disregard that one and consider the attached one instead.
Sorry for the confusion. Javier
diff -Nru debsums-2.0.13/debian/changelog debsums-2.0.13.1/debian/changelog --- debsums-2.0.13/debian/changelog 2004-12-05 19:41:51.000000000 +0100 +++ debsums-2.0.13.1/debian/changelog 2005-01-29 16:08:46.000000000 +0100 @@ -1,3 +1,14 @@ +debsums (2.0.13.1) unstable; urgency=low + + * Will not warn on locale purged files if /etc/locale.nopurge + exists, unless --no-locale-purge is given (Closes: #149029) + * Print full path when printing file paths (Closes: #210970) + * Document that the manpage example will not work for CD-ROM and + local sources, see #191840 + * Added an option to check only configuration files (Closes: #261123) + + -- Javier Fernandez-Sanguino Pen~a <[EMAIL PROTECTED]> Sat, 29 Jan 2005 15:40:13 +0100 + debsums (2.0.13) unstable; urgency=low * Add template translation [nl] from Luk Claes (closes: #274903). diff -Nru debsums-2.0.13/debsums.1 debsums-2.0.13.1/debsums.1 --- debsums-2.0.13/debsums.1 2002-09-09 14:37:22.000000000 +0200 +++ debsums-2.0.13.1/debsums.1 2005-01-29 16:08:09.000000000 +0100 @@ -11,12 +11,25 @@ .RI [ package | deb ] \&... .SH DESCRIPTION -Verify installed Debian package files against MD5 checksum lists. +.I debsums +will verify installed Debian package files against MD5 checksum lists and +provide a list of those files that hold a different MD5 checksum as +opposed to the checksum listed provided in +.RI /var/lib/dpkg/info/ package .md5sums. +.P +.I debsums +can generate the checksum list for packages that don't provide one. It is +also aware of +.I locale-purge +and will not check purged locale files. .SH OPTIONS .TP .BR \-a ", " \-\-all Also check configuration files (normally excluded). .TP +.BR \-e ", " \-\-config +\fBOnly\fR check configuration files. +.TP .BR \-c ", " \-\-changed Report changed file list to stdout (implies .BR \-s ). @@ -51,6 +64,9 @@ .IP may be used to populate the cache with any debs not already in the cache. +.I Note: +This will not work for CD-ROM and other local sources as there is no +cache file for them under \fI/var/cache\fR. .TP .BR \-g ", " \-\-generate =[ missing | all ][, keep [, nocheck ]] Generate MD5 sums from deb contents. If the argument is a package @@ -84,6 +100,10 @@ is equivalent to .BR \-\-generate=missing . .LP +.BR \-\-no\-locale\-purge +.PD +Will print debsums errors for purged locale. +.TP .B \-\-help .PD 0 .TP @@ -144,6 +164,12 @@ from known safe media (such as a bootable rescue CD, see the \-\-root option) and the checksums are take from debs (\-\-generate=all) which are either on that media or validated using the \-\-md5sums option. +.PP +If you are looking for an integrity checkers that can run from safe +media, do integrity checks on checksum databases and can be easily +configured to run periodically to warn the admin of changes you should +better look at other tools like: \fIaide\fR, \fIintegrit\fR, +\fIsamhain\fR, or \fItripwire\fR. .SH AUTHOR Written by Brendan O'Dea <[EMAIL PROTECTED]>. .br diff -Nru debsums-2.0.13/debsums.in debsums-2.0.13.1/debsums.in --- debsums-2.0.13/debsums.in 2004-07-24 10:47:55.000000000 +0200 +++ debsums-2.0.13.1/debsums.in 2005-01-29 16:07:28.000000000 +0100 @@ -34,6 +34,7 @@ Options: -a, --all check configuration files (normally excluded) + -e, --config check only configuration files -c, --changed report changed files (implies -s) -l, --list-missing list packages which don't have an md5sums file -s, --silent only report errors @@ -43,6 +44,7 @@ -p, --deb-path=DIR[:DIR...] search path for debs -g, --generate=[all][,keep[,nocheck]] generate md5sums from deb contents + --no-locale-purge warn on locale files even if locale-purge is used --help print this help, then exit --version print version number, then exit EOT @@ -50,6 +52,7 @@ my $gen_opt; GetOptions ( 'a|all' => \my $all, + 'e|config' => \my $config, 'c|changed' => \my $changed, 'l|list-missing' => \my $missing, 's|silent' => \my $silent, @@ -58,6 +61,7 @@ 'd|admindir=s' => \my $admindir, 'p|deb-path=s' => \my $debpath, 'generate=s' => \$gen_opt, + 'nolocalepurge' => \my $nolocalepurge, g => sub { $gen_opt = 'missing' }, help => sub { print $help; exit }, version => sub { print $version; exit }, @@ -67,6 +71,19 @@ $admindir ||= '/var/lib/dpkg'; my $DPKG = $root . $admindir; +my $localepurges = ""; + +if( -r "/etc/locale.nopurge") { + open(LOCALE, "/etc/locale.nopurge"); + my $line; + foreach $line (<LOCALE>) { + chop $line; + $localepurges .= $line."|" if $line=~ /^[a-z].+/; + } + close LOCALE; + $localepurges =~ s/\|$//; +} + $silent++ if $changed; my @debpath = '.'; @@ -215,7 +232,16 @@ unless (open F, "$root/$path") { - warn "$self: can't open $pack file $path ($!)\n"; + return 0 if ( ! $nolocalepurge && $localepurges ne "" + && ( ($path =~ /^usr\/share\/man\/[^\/]+?\/man[0-9]\// && + $path !~ /^usr\/share\/man\/($localepurges)\/man[0-9]\// + ) || + ($path =~ /^usr\/share\/locale\/[^\/]+?\// && + $path !~ /^usr\/share\/locale\/($localepurges)\// )|| + 0) + ); + + warn "$self: can't open $pack file $root/$path ($!)\n"; return 0; } @@ -225,29 +251,29 @@ my $s = $digest->hexdigest; if ($s eq $sum) { - printf "%-*s OK\n", $width, $path unless $silent; + printf "%-*s OK\n", $width, "$root/$path" unless $silent; return 1; } if (is_replaced $pack, $path, $s) { - printf "%-*s REPLACED\n", $width - 6, $path unless $silent; + printf "%-*s REPLACED\n", $width - 6, "$root/$path" unless $silent; return 1; } if ($changed) { - print $path, "\n"; + print $root, "/", $path, "\n"; return 1; } if ($silent) { - warn "$self: checksum mismatch $pack file $path\n"; + warn "$self: checksum mismatch $pack file $root/$path\n"; } else { - printf "%-*s FAILED\n", $width - 4, $path; + printf "%-*s FAILED\n", $width - 4, "$root/$path"; } return 0; @@ -491,13 +517,18 @@ next; } - next if exists $conffiles->{$path}; - $status = 1 unless check $pack, $path, $sum; + if ($config) { + next if ! exists $conffiles->{$path}; + $status = 1 unless check $pack, $path, $sum; + } else { + next if exists $conffiles->{$path}; + $status = 1 unless check $pack, $path, $sum; + } } close SUMS; - next unless $all and %$conffiles; + next unless ! $config and $all and %$conffiles; while (my ($path, $sum) = each %$conffiles) { $status = 1 unless check $pack, $path, $sum;
signature.asc
Description: Digital signature