.\" $Id: pkg_ids.1,v 1.3 2005/04/24 21:21:21 jschauma Exp $ .\" .\" Copyright (c) 2005 Jan Schaumann .\" All rights reserved. .\" .\" 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. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by Jan Schaumann. .\" 4. Neither the name of the author nor the names of any contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED .\" TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR .\" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS .\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" .Dd April 21, 2005 .Dt PKG_IDS 1 .Os .Sh NAME .Nm pkg_ids .Nd checksum installed packages .Sh SYNOPSIS .Nm .Op help|version .Op verbose= .Op cnfgfile= .Op dbchksums= .Op dbdir= .Op ignorefrom= .Op pkgs= .Sh DESCRIPTION The .Nm utility checksums all files of all installed packages and compares the result against the previously recorded checksum in the packages' db file. When invoked without any arguments, .Nm calculates the checksums for all files of all installed packages. This is obviously an expensive operation and may take some time. .Pp Upon first invocation, .Nm calculates the checksum of each package's .Pa +CONTENTS file. On subsequent runs, .Nm will print a warning if any of the packages' .Pa +CONTENTS files has been modified and continue without checking this package. .Sh OPTIONS The following options are available: .Bl -tag -width ignorefrom .It help Display usage message and exit. .It version Display version information and exit. .It verbose= Set verbosity level. The following levels are currently supported: .Bl -tag -width 0 .It 0 Only display the names of the packages that contain mismatched files. .It 1 The default level of verbosity. Each file that does not match the recorded checksum is printed out. .It 2 Display extra information. For each file that is processed, a '.' is printed. A summary is printed after all packages have been processed. .El .It cnfgfile= Allows the user to specify the .Ar path to the configuration file for .Nm . Per default, .Nm looks in .Pa ~/.pkg_ids/pkg_idsrc . .It dbchksums= Allows the user to specify the .Ar path to the file where the checksums of each package's .Pa +CONTENTS file is stored in. Per default, .Nm looks in .Pa ~/.pkg_ids/dbsums . .It dbdir= Allows the user to specify the directory in which the package databases are stored. Per default, .Nm looks in .Ar PKG_DBDIR , or, if that is not specified, .Pa /var/db/pkg . .It ignorefrom= Allows the user to specify a .Ar path to the file that contains a list of files to ignore when running .Nm . See below for details. .It pkgs= Allows the user to specify a pattern of packages to analyze instead of all packages. A regular shell pattern can be given. .El .Sh FILES As mentioned above, .Nm supports a configuration file to let the user specify some of the parameters instead of on the command-line. Each line in the configuration file ( .Pa ~/.pkg_ids/pkg_idsrc per default ) must be a .Ar parameter=value pair. All of the command-line parameters with the obvious exception of the .Ar cnfgfile , .Ar help , and .Ar version parameters are currently supported. Empty lines and lines starting with a '#' are ignored. .Pp .Nm also consults the file specified by the .Ar dbchksums parameter ( .Ar ~/.pkg_ids/dbsums per default ) to verify the integrity of the packages' .Ar +CONTENTS files. This file contains lines of three fields each (empty lines and lines starting with a '#' are ignored): .Bl -tag -width algorithm .It path The absolute path of a file. .It algorithm The algorithm used to calculate the checksum for this file. .It chksum The checksum recorded for this file using the .Ar algorithm specified earlier. .El .Pp Finally, if the .Ar ignorefrom parameter is specified (either via the command-line or from the configuration file), .Nm will consult it to determine which mismatches are known. This file has the same format as the .Ar dbchksums file. Files that are listed in the .Ar ignorefrom file are checked against the recorded checksum as specified and are reported as mismatches if the checksum is found to be different. Should the recorded checksum not be accurate, but instead the file is found to match the checksum of the original package, a different warning is issued. .Sh AUTHORS The .Nm utility was written by Jan Schaumann . .Sh ENVIRONMENT The .Nm utility uses the .Ar PKG_DBDIR environment variable. .Sh SEE ALSO .Xr audit-packages 1 , .Xr digest 1 , .Xr pkg_add 1 , .Xr pkg_delete 1 , .Xr pkg_info 1