#!/usr/bin/perl

# quicktrip - a quick and dirty tripwire-like program

# list of files that need to be checked
my $filelist = "/local/lib/quicktrip.list";
open LIST, "< $filelist";

# list of all setuid root files on the system
open SETUID, "find / -type f -perm -4000 -user root -print |";

# Get a list of files to check.
my @list = (
            $filelist,     # make sure nobody changes the list
            <LIST>,        # all of the files in the list
            <SETUID>,      # all the setuid root files
        );

close LIST;
close SETUID;

# Collect info, ready to be compared against a previous run.
for (sort @list) {
    my $info;
    if ( -f $_ ) {
        $info = MD5_md5_checksum_file $_;
    }
    print "$_: $info\n";
}
