Index: trunk/scripts/README
===================================================================
--- trunk/scripts/README	(revision 478)
+++ trunk/scripts/README	(revision 481)
@@ -38,17 +38,4 @@
    Run 'yuleadmin.pl -h' for usage instructions.
 
-samhainrc_update.sh
--------------------
-
-   If you are using the --with-kcheck option on Linux, after a kernel
-   update you need to change some option (addresses of kernel functions)
-   in the samhainrc configuration file. The correct new addresses must
-   be looked up in the System.map file
-
-   This script will do this automatically. Run 'samhainrc_update.sh -h'
-   for usage instructions. You may need to change the location of the
-   samhainrc file by editing the line 'cfgfile="/etc/samhainrc"'
-   at the beginning of the script.
- 
 check_samhain.pl
 ----------------
Index: trunk/scripts/redhat_i386.client.spec.in
===================================================================
--- trunk/scripts/redhat_i386.client.spec.in	(revision 478)
+++ trunk/scripts/redhat_i386.client.spec.in	(revision 481)
@@ -123,10 +123,4 @@
 fi
 
-%postun
-if [ "$1" = 0 ]; then
-        # remove any kernel modules that might have been installed
-        RVER=`uname -r`
-        rm -f /lib/modules/$RVER/samhain*
-fi
 
 
@@ -136,5 +130,5 @@
 %dir /var/log
 #%doc docs/BUGS COPYING docs/Changelog docs/TODO
-#%doc LICENSE docs/HOWTO* docs/MANUAL-2_3.* docs/README*
+#%doc LICENSE docs/HOWTO* docs/MANUAL-2_4.* docs/README*
 /etc
 /usr/local/sbin/samhain
Index: trunk/scripts/samhain.ebuild.in
===================================================================
--- trunk/scripts/samhain.ebuild.in	(revision 478)
+++ trunk/scripts/samhain.ebuild.in	(revision 481)
@@ -69,5 +69,5 @@
 	dodoc docs/BUGS COPYING docs/Changelog LICENSE docs/README \
 	      docs/README.UPGRADE docs/sh_mounts.txt docs/sh_userfiles.txt \
-	      docs/MANUAL-2_3.ps docs/MANUAL-2_3.html.tar
+	      docs/MANUAL-2_4.ps docs/MANUAL-2_4.html.tar
 
 	dohtml docs/HOWTO-client+server.html docs/HOWTO-samhain+GnuPG.html \
Index: trunk/scripts/samhain.spec.in
===================================================================
--- trunk/scripts/samhain.spec.in	(revision 478)
+++ trunk/scripts/samhain.spec.in	(revision 481)
@@ -109,11 +109,4 @@
 fi
 
-%postun
-if [ "$1" = 0 ]; then
-        # remove any kernel modules that might have been installed
-        RVER=`uname -r`
-        rm -f /lib/modules/$RVER/samhain*
-fi
-
 
 %files
@@ -122,5 +115,5 @@
 %dir %{_localstatedir}/log
 %doc docs/BUGS COPYING docs/Changelog docs/TODO
-%doc LICENSE docs/HOWTO* docs/MANUAL-2_3.* docs/README*
+%doc LICENSE docs/HOWTO* docs/MANUAL-2_4.* docs/README*
 %{_localstatedir}/lib/%{name}
 %{_sbindir}/%{name}
Index: trunk/scripts/samhainadmin.pl.in
===================================================================
--- trunk/scripts/samhainadmin.pl.in	(revision 478)
+++ trunk/scripts/samhainadmin.pl.in	(revision 481)
@@ -156,7 +156,10 @@
     print "    Set the passphrase for gpg. By default, gpg will ask.\n\n";
 
-    print "  -s secretkeyring --secretkeyring secretkeyring\n";
-    print "    Select an alternate secret keyring for gpg.\n";
-    print "    Will use '$ENV{'HOME'}/.gnupg/secring.gpg' by default.\n\n";
+    print "  -s gnupg_homedir --secretkeyring gnupg_homedir\n";
+    print "    Select an alternate gpg homedirectory to locate the secret keyring.\n";
+    print "    Will use '$ENV{'HOME'}/.gnupg/' by default.\n\n";
+
+    print "  -k keyid      --keyid keyid\n";
+    print "   Select the keyid to use for signing.\n\n";
 
     print "  -l            --list\n";
@@ -570,4 +573,5 @@
 	    'p|passphrase=s',
 	    's|secretkeyring=s',
+            'k|keyid=s',
 	    'create-cfgfile',  # -m F
 	    'print-cfgfile',   # -m f
@@ -584,4 +588,8 @@
 }
 
+if (defined($opts{'k'})) {
+    $TARGETKEYID = $opts{'k'};
+    $KEYTAG = "--default-key";
+}
 if (defined($opts{'c'})) {
     $cfgfile = $opts{'c'};
Index: trunk/scripts/samhainrc_update.sh
===================================================================
--- trunk/scripts/samhainrc_update.sh	(revision 478)
+++ 	(revision )
@@ -1,315 +1,0 @@
-#! /bin/sh
-
-# Copyright Rainer Wichmann (2006)
-#
-# License Information:
-# 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
-# (at your option) 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.
-
-
-# -----------------------------------------------------------------------
-# The default configuration file
-# -----------------------------------------------------------------------
-
-cfgfile="/etc/samhainrc"
-
-# -----------------------------------------------------------------------
-# Be Bourne compatible
-# -----------------------------------------------------------------------
-
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
-fi
-
-programname="$0"
-sysmap=
-
-# -----------------------------------------------------------------------
-# Print help
-# -----------------------------------------------------------------------
-
-showhelp() {
-    echo
-    echo "$programname - update samhain config file after kernel update"
-    echo
-    echo "OPTIONS:"
-    echo
-    echo " -u|--update </path/to/System.map>"
-    echo "         Update the configuration file with new"
-    echo "         settings as taken from </path/to/System.map>"
-    echo
-    echo " -c|--config-file </path/to/config-file>"
-    echo "         Specify the configuration file to update [${cfgfile}]"
-    echo
-    echo " -p|--print-only </path/to/System.map>"
-    echo "         Print new settings, don't modify anything"
-    echo
-    echo " -h|--help"
-    echo "         Print this help"
-    echo
-    echo " -n|--nocolor"
-    echo "         (ignored, legacy support)"
-    echo
-}
-
-
-# -----------------------------------------------------------------------
-# Death strikes
-# -----------------------------------------------------------------------
-
-die() {
-    echo ${1+"$@"} >&2
-    { (exit 1); exit 1; }
-}
-
-# -----------------------------------------------------------------------
-# Get new settings from </path/to/System.map>
-# -----------------------------------------------------------------------
-
-system_call=
-syscall_table=
-proc_root=
-proc_root_inode_operations=
-proc_root_lookup=
-
-get_new_settings() {
-
-    if [ -z "$sysmap" ]; then
-	die "No System.map specified"
-    fi
-    if [ -f "$sysmap" ]; then
-	if [ -r "$sysmap" ]; then
-	    system_call=`egrep '[[:alnum:]]{8}[[:space:]]+[[:alpha:]]{1}[[:space:]]+system_call$' ${sysmap} | awk '{ print $1 }'`
-	    syscall_table=`egrep '[[:alnum:]]{8}[[:space:]]+[[:alpha:]]{1}[[:space:]]+sys_call_table$' ${sysmap} | awk '{ print $1 }'`
-	    proc_root=`egrep '[[:alnum:]]{8}[[:space:]]+[[:alpha:]]{1}[[:space:]]+proc_root$' ${sysmap} | awk '{ print $1 }'`
-	    proc_root_inode_operations=`egrep '[[:alnum:]]{8}[[:space:]]+[[:alpha:]]{1}[[:space:]]+proc_root_inode_operations$' ${sysmap} | awk '{ print $1 }'`
-	    proc_root_lookup=`egrep '[[:alnum:]]{8}[[:space:]]+[[:alpha:]]{1}[[:space:]]+proc_root_lookup$' ${sysmap} | awk '{ print $1 }'`
-	else
-	    die "System.map ${sysmap} not readable"
-	fi
-    else
-	die "System.map ${sysmap} not found"
-    fi
-    test -z "${system_call}" && die "system_call not found in ${cfgfile}"
-    test -z "${syscall_table}" && die "sys_call_table not found in ${cfgfile}"
-    test -z "${proc_root}" && die "proc_root not found in ${cfgfile}"
-    test -z "${proc_root_inode_operations}" && die "proc_root_inode_operations not found in ${cfgfile}"
-    test -z "${proc_root_lookup}" && die "proc_root_lookup not found in ${cfgfile}"
-
-}
-
-# -----------------------------------------------------------------------
-# Print new settings
-# -----------------------------------------------------------------------
-
-run_print() {
-    get_new_settings
-    echo
-    echo "KernelSystemCall =     0x${system_call}"
-    echo "KernelSyscallTable =   0x${syscall_table}"
-    echo "KernelProcRoot =       0x${proc_root}"
-    echo "KernelProcRootIops =   0x${proc_root_inode_operations}"
-    echo "KernelProcRootLookup = 0x${proc_root_lookup}"
-    echo
-}
-
-# -----------------------------------------------------------------------
-# Replace a setting
-# -----------------------------------------------------------------------
-
-# set ignorecase
-# search pattern
-# delete current line
-# insert
-# single dot == end of insert text
-# save and exit
-
-run_replace() {
-    item="$1"
-    address="$2"
-    ex -s "$cfgfile" <<EOF
-:set ic
-:/^[[:blank:]]*$1[[:blank:]]*=
-:d
-:i
-$item = $address
-.
-:x
-EOF
-}
-
-# -----------------------------------------------------------------------
-# Add a setting
-# -----------------------------------------------------------------------
-
-# set ignorecase
-# search pattern ([Kernel] section)
-# append (next line)
-# single dot == end of insert text
-# save and exit
-
-run_add() {
-    item="$1"
-    address="$2"
-    ex -s "$cfgfile" <<EOF
-:set ic
-:/^[[:space:]]*\[Kernel\]
-:a
-$item = $address
-.
-:x
-EOF
-}
-
-# -----------------------------------------------------------------------
-# Update with new settings
-# -----------------------------------------------------------------------
-
-run_update() {
-
-    get_new_settings
-
-    if [ -z "$cfgfile" ]; then
-	die "No configuration file specified"
-    fi
-    if [ ! -w "$cfgfile" ]; then
-	die "Configuration file ${cfgfile} not writeable"
-    fi
-    egrep '^[[:space:]]*\[Kernel\]' "$cfgfile" >/dev/null
-    if [ $? -ne 0 ]; then
-	die "No [Kernel] section in configuration file $cfgfile"
-    fi
-
-    cat "$cfgfile" | egrep -i 'KernelProcRootLookup' >/dev/null
-    if [ $? -eq 0 ]; then
-	run_replace 'KernelProcRootLookup' "0x${proc_root_lookup}"
-    else
-	run_add 'KernelProcRootLookup' "0x${proc_root_lookup}"
-    fi
- 
-    cat "$cfgfile" | egrep -i 'KernelProcRootIops' >/dev/null
-    if [ $? -eq 0 ]; then
-	run_replace 'KernelProcRootIops' "0x${proc_root_inode_operations}"
-    else
-	run_add 'KernelProcRootIops' "0x${proc_root_inode_operations}"
-    fi
-
-    cat "$cfgfile" | egrep -i 'KernelProcRoot[[:space:]]*=' >/dev/null
-    if [ $? -eq 0 ]; then
-	run_replace 'KernelProcRoot' "0x${proc_root}"
-    else
-	run_add 'KernelProcRoot' "0x${proc_root}"
-    fi
-
-    cat "$cfgfile" | egrep -i 'KernelSyscallTable' >/dev/null
-    if [ $? -eq 0 ]; then
-	run_replace 'KernelSyscallTable' "0x${syscall_table}"
-    else
-	run_add 'KernelSyscallTable' "0x${syscall_table}"
-    fi
-
-    cat "$cfgfile" | egrep -i 'KernelSystemCall' >/dev/null
-    if [ $? -eq 0 ]; then
-	run_replace 'KernelSystemCall' "0x${system_call}"
-    else
-	run_add 'KernelSystemCall' "0x${system_call}"
-    fi
-
-}
-
-# -----------------------------------------------------------------------
-# Parse command line
-# -----------------------------------------------------------------------
-
-sysmap=
-action=
-
-for option
-do
-
-  # If the previous option needs an argument, assign it.
-  #
-  if test -n "$opt_prev"; then
-    eval "$opt_prev=\$option"
-    eval export "$opt_prev"
-    opt_prev=
-    continue
-  fi
-
-  case "$option" in
-      -*=*) 
-	  optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` 
-	  ;;
-      *) 
-	  optarg= 
-	  ;;
-  esac
-
-  case "$option" in
-
-      -h|--help)
-	  showhelp
-	  exit 0
-	  ;;
-
-      -n|--nocolor)
-	  ;;
-
-      -c|--config-file)
-	  opt_prev=cfgfile
-	  ;;
-
-      -c=* | --config-file=*)
-	  cfgfile="$optarg"
-	  ;;
-
-      -p|--print-only)
-	  opt_prev=sysmap
-	  action=p
-	  ;;
-
-
-      -p=* | --print-only=*)
-	  sysmap="$optarg"
-	  action=p
-	  ;;
-    
-      -u|--update)
-	  opt_prev=sysmap
-	  action=u
-	  ;;
-
-      -u=* | --update=*)
-	  sysmap="$optarg"
-	  action=u
-	  ;;
-
-  esac
-
-done
-
-if [ x"$action" = xp ]; then
-    run_print
-    exit 0
-fi
-if [ x"$action" = xu ]; then
-    run_update
-    exit 0
-fi
-
-showhelp
-exit 1
