Ticket #22951: patch-configure.diff

File patch-configure.diff, 8.1 KB (added by groolot@…, 15 years ago)

Patch for the configure file of the autopsy-2.21 configure script

  • configure

    old new  
    88
    99# Configuration script for the Autopsy Forensic Browser
    1010#
     11# This configuration file has been adapted to comply with
     12# MacPorts port installation system.
     13#
    1114# Brian Carrier [carrier@sleuthkit.org]
    1215#
    1316# Copyright (c) 2003-2008 by Brian Carrier.  All rights reserved
     
    6770      else     
    6871        echo "perl found: ${d}perl (version $ver)";
    6972        echo "#!${d}perl -wT" > ./config.tmp;
    70         echo "#!${d}perl" > ./config2.tmp;
    7173        perlexe="${d}perl";
    7274        found=1;
    7375        break;
     
    7981# If it wasn't found, then prompt for it.
    8082if (test $found -eq 0) then
    8183  echo 'ERROR: perl not found or the incorrect version found';
    82   while (test 1 -eq 1)
    83     do echo 'Enter location of perl executable:';
    84     read perlexe;
    85     if (test -x "$perlexe") then
    86       if (test -n "`$perlexe -v 2> /dev/null | awk '/This is perl/ {print $0}'`")       then
    87         ver=`$perlexe -e 'print $];'`;
    88         if (`$perlexe -e 'exit( $] >= 5.008);'`) then
    89           echo "This version of Perl is too old, 5.8.0 or older needed";
    90         else     
    91           echo "Correct version found";
    92           echo "#!${perlexe} -wT" > ./config.tmp;
    93           echo "#!${perlexe}" > ./config2.tmp;
    94           found=1;
    95           break;
    96         fi;
    97       else
    98         echo "Perl found, but is not working.  Try another";
    99       fi;
    100     else
    101       echo "file not found";
    102     fi
    103   done
     84  exit 1;
    10485fi
    10586
    10687# Check if this version of Perl supports large files
     
    10990  echo '    NOTE: It appears that your Perl does not support large files.';
    11091  echo '    You therefore will not be able to analyze images larger than 2GB.';
    11192  echo '    Download the source version from www.cpan.org and compile a new version.';
    112   echo "  [Press Enter to Continue]";
    113   read foo;
    114   echo ''
     93  exit1;
    11594fi;
    11695
    11796# Get current working directory for lib
     
    12099
    121100# Write autopsy
    122101if (test -f ./autopsy) then
    123   echo "autopsy already exists, overwrite? (y/n):";
    124   read rep;
    125   if (test "$rep" = "y") then
    126     cat ./config.tmp base/autopsy.base > ./autopsy
    127     cat ./config2.tmp base/make-live-cd.base > ./make-live-cd
    128   else
    129     echo '  original version was kept';
    130   fi
     102  echo "autopsy already exists, backup to autopsy.old";
     103  mv ./autopsy ./autopsy.old
     104  cat ./config.tmp base/autopsy.base > ./autopsy
    131105else
    132106  cat ./config.tmp base/autopsy.base > ./autopsy
    133   cat ./config2.tmp base/make-live-cd.base > ./make-live-cd
    134107fi
    135108chmod 0755 ./autopsy
    136 chmod 0755 ./make-live-cd
    137109
    138110# cleanup
    139111rm -f ./config.tmp
    140 rm -f ./config2.tmp
    141112
    142113
    143114#############################################################################
     
    146117
    147118
    148119conf='conf.pl'
    149 
    150120if (test -f $conf) then
    151   echo "A configuration file already exists, overwrite? (y/n):";
    152   read rep;
    153   if (test "$rep" = "n") then
    154     exit 0;
    155   fi
     121  echo "A configuration file already exists, backup to $conf.old";
     122  mv $conf $conf.old
    156123fi
    157124
    158 # echo ''
    159 # echo '---------------------------------------------------------------'
    160 # echo ''
    161 # echo 'Autopsy can use the configuration file from a previous installation'
    162 # echo ''
    163 # echo 'Would you like to use a previous configuration file (y/n) [n]'
    164 # read rep;
    165 # if (test "$rep" = "y") then
    166 
    167 #  echo 'Enter the directory of the previous installation (or cancel):'
    168 #  while (test 1 -eq 1)
    169 #    do read prevdir;
    170 #    if (test "$prevdir" = "cancel") then
    171 #               break;
    172 #       fi;
    173 #    if (test -f "${prevdir}/conf.pl") then
    174 #               /bin/cp "${prevdir}/conf.pl" .
    175 #               echo '  Configuration file copied from $prevdir';
    176 
    177 #               # Check the config status
    178 #               exit 0;
    179 #       fi;
    180 #    echo 'Configuration file not found, try again (or 'cancel' to stop):'
    181 #  done;
    182 #fi;
    183 
    184125
    185126# First add the variables that are static
    186127#
     
    240181# Prompt if not found
    241182if (test $found -eq 0) then
    242183  echo 'ERROR: grep utility not found';
    243   echo 'Enter location of executable:';
    244   while (test 1 -eq 1)
    245     do read grepexe;
    246     if (test -x "$grepexe") then
    247           echo \$GREP_EXE = \'$grepexe\'\; >> $conf;
    248       break;
    249     else
    250       echo 'grep was not found (try again):';
    251     fi;
    252   done
     184  exit 1;
    253185fi
    254186
    255187
     
    269201# Prompt if not found
    270202if (test $found -eq 0) then
    271203  echo 'ERROR: file utility not found';
    272   echo 'Enter location of executable:';
    273   while (test 1 -eq 1)
    274     do read fileexe;
    275     if (test -x "$fileexe") then
    276           echo \$FILE_EXE = \'$filexe\'\; >> $conf;
    277       break;
    278     else
    279       echo 'file was not found (try again):';
    280     fi;
    281   done
     204  exit 1;
    282205fi
    283206
    284207#
     
    302225# Prompt if not found
    303226if (test $found -eq 0) then
    304227  echo 'ERROR: md5/md5sum utility not found';
    305   echo 'Enter location of executable:';
    306   while (test 1 -eq 1)
    307     do read md5exe;
    308     if (test -x "$md5exe") then
    309           echo \$MD5_EXE = \'$md5exe\'\; >> $conf;
    310       break;
    311     else
    312       echo 'md5 was not found (try again):';
    313     fi;
    314   done
     228  exit 1;
    315229fi
    316230
    317231
     
    373287if (test $found -eq 0) then
    374288  echo 'Sleuth Kit tools were not found in the standard install locations.'
    375289  echo 'If you have not installed them, do so now and configure autopsy again.'
    376   echo 'If you have installed them in a non-standard location, then'
    377   echo '  enter the "bin" directory now:'
    378 
    379   while (test 1 -eq 1)
    380     do read tskdir;
    381     if ((test -x ${tskdir}/fls) && (test -x ${tskdir}/ffind) && (test -x ${tskdir}/blkstat) && \
    382           (test -x ${tskdir}/blkls) && (test -x ${tskdir}/blkcat) && \
    383           (test -x ${tskdir}/mmls) && (test -x ${tskdir}/mmstat) && \
    384           (test -x ${tskdir}/fsstat) && (test -x ${tskdir}/img_stat) && \
    385           (test -x ${tskdir}/istat) && (test -x ${tskdir}/ifind) && \
    386           (test -x ${tskdir}/icat) && (test -x ${tskdir}/ils) && \
    387           (test -x ${tskdir}/srch_strings) && \
    388           (test -x ${tskdir}/mactime) && (test -x ${tskdir}/sorter)) then
    389       echo \$TSKDIR = \'${tskdir}\'\; >> $conf;
    390       break;
    391     else
    392       echo 'TSK tools were not found or incomplete (try again):';
    393     fi;
    394   done
     290  exit 1;
    395291fi;
    396292
    397293# Test for latest version
     
    405301elif (test "$ver" '<' "$curtskver") then
    406302        echo '';
    407303    echo "*** NOTE: A more recent version ($curtskver) of The Sleuth Kit Exists ***"
    408         echo "  [Press Enter to Continue]";
    409         read foo;
    410 
    411304else
    412305        echo '  Required version found';
    413306fi
     
    422315echo 'hash values of known good and bad files.'
    423316echo '         http://www.nsrl.nist.gov'
    424317echo ''
    425 echo 'Have you purchased or downloaded a copy of the NSRL (y/n) [n]'
    426 read rep;
    427 if (test "$rep" = "y") then
    428 
    429   echo 'Enter the directory where you installed it:'
    430   while (test 1 -eq 1)
    431     do read nsrldir;
    432     if (test "$nsrldir" = "cancel") then
    433         echo \$NSRLDB = \'\'\; >> $conf;
    434                 break;
    435         fi;
    436     if (test -f "${nsrldir}/NSRLFile.txt") then
    437       echo '  NSRL database was found (NSRLFile.txt)';
    438       echo \$NSRLDB = \'${nsrldir}/NSRLFile.txt\'\; >> $conf;
    439 
    440           if (test -f "${nsrldir}/NSRLFile.txt-md5.idx") then
    441                 echo '  NSRL Index file found (NSRLFile.txt-md5.idx)';
    442       else
    443         echo '  NSRL Index file not found, do you want it created? (y/n) [n]:'
    444         read rep;
    445         if (test "$rep" = "y") then
    446           echo ''
    447           echo '-------------- begin hfind output --------------'
    448           "${tskdir}/hfind" -i nsrl-md5 "${nsrldir}/NSRLFile.txt";
    449           echo '--------------- end hfind output ---------------'
    450           echo ''
    451                 fi;
    452           fi;
    453       break;
    454     else
    455       echo 'The NSRL was not found (the directory should have NSRLFile.txt in it)';
    456           echo 'Enter a new directory (or cancel to stop):';
    457     fi;
    458   done
    459 else
    460   echo \$NSRLDB = \'\'\; >> $conf;
    461 fi;
     318echo \$NSRLDB = \'\'\; >> $conf;
    462319
    463320#############################################################################
    464321# EVIDENCE LOCKER
     
    470327echo 'Autopsy saves configuration files, audit logs, and output to the'
    471328echo 'Evidence Locker directory.'
    472329echo ''
    473 echo 'Enter the directory that you want to use for the Evidence Locker:';
    474 read locker;
     330locker='MP_AUTOPSY_LOCKER'
    475331if (test -d "${locker}") then
    476332  echo "  $locker already exists"
    477333else